+ if (battle->ActiveHero().SpellMenu().SelectedIsEnabled()) {
+ AttackChoice &ac(battle->ActiveHero().GetAttackChoice());
+ const Spell *spell(battle->ActiveHero().SpellMenu().Selected());
+ ac.Selection().Reset();
+ if (spell->GetTargetingMode().TargetsAlly()) {
+ ac.Selection().SelectHeroes();
+ } else {
+ ac.Selection().SelectMonsters();
+ }
+ if (spell->GetTargetingMode().TargetsAll()) {
+ ac.SetType(AttackChoice::MAGIC);
+ ac.SetSpell(spell);
+ battle->NextHero();
+ ctrl->PopState();
+ } else {
+ if (spell->GetTargetingMode().TargetsSingle()) {
+ ac.Selection().SetSingle();
+ } else {
+ ac.Selection().SetMultiple();
+ }
+ ctrl->PushState(new SelectTarget(battle, parent, &ac.Selection(), battle->Res().magicTargetCursor));
+ }