diff --git a/client/battle/CBattleInterface.cpp b/client/battle/CBattleInterface.cpp index 6606e6dd8..8576a3d66 100644 --- a/client/battle/CBattleInterface.cpp +++ b/client/battle/CBattleInterface.cpp @@ -859,17 +859,17 @@ void CBattleInterface::reallySurrender() void CBattleInterface::bAutofightf() { - if (spellDestSelectMode) //we are casting a spell + if(spellDestSelectMode) //we are casting a spell return; //Stop auto-fight mode - if (curInt->isAutoFightOn) + if(curInt->isAutoFightOn) { assert(curInt->autofightingAI); curInt->isAutoFightOn = false; logGlobal->trace("Stopping the autofight..."); } - else + else if(!curInt->autofightingAI) { curInt->isAutoFightOn = true; blockUI(true); @@ -1619,7 +1619,9 @@ void CBattleInterface::activateStack() setActiveStack(stackToActivate); stackToActivate = nullptr; - const CStack *s = activeStack; + const CStack * s = activeStack; + if(!s) + return; queue->update(); redrawBackgroundWithHexes(activeStack);