1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-23 22:37:55 +02:00

Make pass/force action spells take effect immediately after being reflected on an active unit

This commit is contained in:
Opuszek
2025-07-10 17:06:26 +02:00
parent 8e6af8ed78
commit e9f0ffed88

View File

@@ -616,10 +616,16 @@ void BattleFlowProcessor::onActionMade(const CBattleInfoCallback & battle, const
{
if (activeStack && activeStack->alive())
{
// this is action made by hero AND unit is alive (e.g. not killed by casted spell)
bool activeStackAffectedBySpell = !activeStack->canMove() ||
tryActivateBerserkPenalty(battle, battle.battleGetStackByID(battle.getBattle()->getActiveStackID()));
// this is action made by hero AND unit is neither killed nor affected by reflected spell like blind or berserk
// keep current active stack for next action
setActiveStack(battle, activeStack, BattleUnitTurnReason::HERO_SPELLCAST);
return;
if (!activeStackAffectedBySpell)
{
setActiveStack(battle, activeStack, BattleUnitTurnReason::HERO_SPELLCAST);
return;
}
}
}