mateuszb há 15 anos atrás
pai
commit
bb5d765247
1 ficheiros alterados com 9 adições e 0 exclusões
  1. 9 0
      client/CBattleInterface.cpp

+ 9 - 0
client/CBattleInterface.cpp

@@ -371,6 +371,11 @@ void CReverseAnim::nextFrame()
 			owner->creDir[stackID] = !owner->creDir[stackID];
 
 			const CStack * curs = owner->curInt->cb->battleGetStackByID(stackID, false);
+			if(!curs)
+			{
+				endAnim();
+				return;
+			}
 
 			Point coords = CBattleHex::getXYUnitAnim(hex, owner->creDir[stackID], curs, owner);
 			owner->creAnims[stackID]->pos.x = coords.x;
@@ -1298,6 +1303,10 @@ CBattleInterface::CBattleInterface(const CCreatureSet * army1, const CCreatureSe
 
 CBattleInterface::~CBattleInterface()
 {
+	if (active) //dirty fix for #485
+	{
+		deactivate();
+	}
 	SDL_FreeSurface(background);
 	SDL_FreeSurface(menu);
 	SDL_FreeSurface(amountNormal);