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:
parent
245d17a9e9
commit
887794e88b
@ -1370,6 +1370,7 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
|
|||||||
{
|
{
|
||||||
CStack * at = gs->curB->getStack(stackAttacked);
|
CStack * at = gs->curB->getStack(stackAttacked);
|
||||||
assert(at);
|
assert(at);
|
||||||
|
at->popBonuses(Bonus::UntilBeingAttacked);
|
||||||
at->count = newAmount;
|
at->count = newAmount;
|
||||||
at->firstHPleft = newHP;
|
at->firstHPleft = newHP;
|
||||||
|
|
||||||
@ -1440,17 +1441,10 @@ DLL_LINKAGE void BattleAttack::applyGs( CGameState *gs )
|
|||||||
attacker->shots--;
|
attacker->shots--;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for(BattleStackAttacked stackAttacked : bsa)
|
for(BattleStackAttacked & stackAttacked : bsa)
|
||||||
stackAttacked.applyGs(gs);
|
stackAttacked.applyGs(gs);
|
||||||
|
|
||||||
attacker->popBonuses(Bonus::UntilAttack);
|
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 )
|
DLL_LINKAGE void StartAction::applyGs( CGameState *gs )
|
||||||
|
Loading…
x
Reference in New Issue
Block a user