1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Do not display "Spell Cancelled" message on right-click when no stack is

active
This commit is contained in:
Ivan Savenko 2023-11-27 13:26:16 +02:00
parent f2e7791326
commit e21e3f8386

View File

@ -999,7 +999,7 @@ void BattleActionsController::onHexRightClicked(BattleHex clickedHex)
return action.spellcast();
};
bool isCurrentStackInSpellcastMode = std::all_of(possibleActions.begin(), possibleActions.end(), spellcastActionPredicate);
bool isCurrentStackInSpellcastMode = !possibleActions.empty() && std::all_of(possibleActions.begin(), possibleActions.end(), spellcastActionPredicate);
if (spellcastingModeActive() || isCurrentStackInSpellcastMode)
{