From bb5d76524737144f5d4c06039ed0da7252cb2579 Mon Sep 17 00:00:00 2001 From: mateuszb Date: Thu, 15 Jul 2010 11:28:06 +0000 Subject: [PATCH] * fixed #485 --- client/CBattleInterface.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/client/CBattleInterface.cpp b/client/CBattleInterface.cpp index e8b18312a..039e63c2a 100644 --- a/client/CBattleInterface.cpp +++ b/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);