fix bug which made several spell leds broken on page 1

This commit is contained in:
2025-01-21 12:23:48 -06:00
parent 92b798c48a
commit 8703c772d4

View File

@@ -2070,9 +2070,7 @@ eSpell pick_spell(short pc_num,eSkill type) { // 70 - no spell OW spell num
cLed& led = dynamic_cast<cLed&>(castSpell[id]);
led.attachKey(key);
castSpell.addLabelFor(id, {static_cast<char>(i > 25 ? toupper(key.c) : key.c)}, LABEL_LEFT, 8, true);
if(spell_index[i] == 90){
continue;
}
// All LEDs should get the click handler and set state, because page 2 will hide them if necessary
led.setState((pc_can_cast_spell(univ.party[pc_casting],cSpell::fromNum(type,on_which_spell_page == 0 ? i : spell_index[i])))
? led_red : led_green);
led.attachClickHandler(std::bind(pick_spell_select_led, _1, _2, _3, type, std::ref(dark), std::ref(former_spell)));