1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-27 22:49:25 +02:00

Cloned stack dissapear when killed.

Fixed #864
This commit is contained in:
DjWarmonger
2012-02-18 17:39:47 +00:00
parent 0867451f26
commit 5c86d32903
7 changed files with 48 additions and 27 deletions

View File

@@ -972,6 +972,12 @@ DLL_LINKAGE void BattleStackAttacked::applyGs( CGameState *gs )
at->casts--;
at->state.insert(EBattleStackState::ALIVE); //hmm?
}
if (cloneKilled())
{
BattleStacksRemoved bsr; //remove body
bsr.stackIDs.insert(at->ID);
bsr.applyGs(gs);
}
}
DLL_LINKAGE void BattleAttack::applyGs( CGameState *gs )
@@ -1006,7 +1012,8 @@ DLL_LINKAGE void BattleAttack::applyGs( CGameState *gs )
for(std::vector<BattleStackAttacked>::const_iterator it = bsa.begin(); it != bsa.end(); ++it)
{
CStack * stack = gs->curB->getStack(it->stackAttacked, false);
stack->getBonusList().remove_if(Bonus::UntilBeingAttacked);
if (stack) //cloned stack is already gone
stack->getBonusList().remove_if(Bonus::UntilBeingAttacked);
}
}