1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Made player interface tolerant to active stack removal.

This commit is contained in:
AlexVinS
2015-10-06 03:46:35 +03:00
parent d042b08682
commit f99bf099ca
6 changed files with 27 additions and 8 deletions

View File

@ -1005,11 +1005,17 @@ void CBattleInterface::newStack(const CStack * stack)
void CBattleInterface::stackRemoved(int stackID)
{
if(activeStack != nullptr)
{
if(activeStack->ID == stackID)
{
setActiveStack(nullptr);
}
}
delete creAnims[stackID];
creAnims.erase(stackID);
creDir.erase(stackID);
//FIXME: what if currently removed stack is active one (Sacrifice)?
redrawBackgroundWithHexes(activeStack);
queue->update();
}