1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-24 08:32:34 +02:00

Process attack/attacked animation before dealing damage to units

This commit is contained in:
Adriankhl 2023-03-25 15:00:25 +01:00
parent 61ed22f553
commit 792ea2f06f

View File

@ -748,11 +748,14 @@ void ApplyFirstClientNetPackVisitor::visitBattleStackMoved(BattleStackMoved & pa
void ApplyFirstClientNetPackVisitor::visitBattleAttack(BattleAttack & pack)
{
callBattleInterfaceIfPresentForBothSides(cl, &IBattleEventsReceiver::battleAttack, &pack);
// battleStacksAttacked should be excuted before BattleAttack.applyGs() to play animation before damaging unit
// so this has to be here instead of ApplyClientNetPackVisitor::visitBattleAttack()
callBattleInterfaceIfPresentForBothSides(cl, &IBattleEventsReceiver::battleStacksAttacked, pack.bsa, pack.shot());
}
void ApplyClientNetPackVisitor::visitBattleAttack(BattleAttack & pack)
{
callBattleInterfaceIfPresentForBothSides(cl, &IBattleEventsReceiver::battleStacksAttacked, pack.bsa, pack.shot());
}
void ApplyFirstClientNetPackVisitor::visitStartAction(StartAction & pack)