1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-08-13 19:54:17 +02:00

Fix crash on using Teleport/Sacrifice spells

This commit is contained in:
Ivan Savenko
2023-03-28 23:50:42 +03:00
parent 0ce06e0f30
commit 06f9759aee

View File

@@ -689,14 +689,14 @@ void BattleActionsController::actionRealize(PossiblePlayerBattleAction action, B
if (action.spell() == SpellID::SACRIFICE) if (action.spell() == SpellID::SACRIFICE)
{ {
heroSpellToCast->aimToHex(targetHex); heroSpellToCast->aimToHex(targetHex);
possibleActions.push_back(PossiblePlayerBattleAction::SACRIFICE); possibleActions.push_back({PossiblePlayerBattleAction::SACRIFICE, SpellID::SACRIFICE});
owner.stacksController->setSelectedStack(targetStack); owner.stacksController->setSelectedStack(targetStack);
return; return;
} }
if (action.spell() == SpellID::TELEPORT) if (action.spell() == SpellID::TELEPORT)
{ {
heroSpellToCast->aimToUnit(targetStack); heroSpellToCast->aimToUnit(targetStack);
possibleActions.push_back(PossiblePlayerBattleAction::TELEPORT); possibleActions.push_back({PossiblePlayerBattleAction::TELEPORT, SpellID::TELEPORT});
owner.stacksController->setSelectedStack(targetStack); owner.stacksController->setSelectedStack(targetStack);
return; return;
} }