1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-26 03:52:01 +02:00

Remove UNTIL_BEING_ATTACKED bonuses after any received damage.

* fixes http://bugs.vcmi.eu/view.php?id=2528
This commit is contained in:
AlexVinS 2016-09-30 02:09:02 +03:00
parent 245d17a9e9
commit 887794e88b

View File

@ -1370,6 +1370,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
{
CStack * at = gs->curB->getStack(stackAttacked);
assert(at);
at->popBonuses(Bonus::UntilBeingAttacked);
at->count = newAmount;
at->firstHPleft = newHP;
@ -1440,17 +1441,10 @@ DLL_LINKAGE void BattleAttack::applyGs( CGameState *gs )
attacker->shots--;
}
}
for(BattleStackAttacked stackAttacked : bsa)
for(BattleStackAttacked & stackAttacked : bsa)
stackAttacked.applyGs(gs);
attacker->popBonuses(Bonus::UntilAttack);
for(auto & elem : bsa)
{
CStack * stack = gs->curB->getStack(elem.stackAttacked, false);
if (stack) //cloned stack is already gone
stack->popBonuses(Bonus::UntilBeingAttacked);
}
}
DLL_LINKAGE void StartAction::applyGs( CGameState *gs )