mirror of
https://github.com/vcmi/vcmi.git
synced 2025-01-26 03:52:01 +02:00
Fix one more battle ai related crash.
This commit is contained in:
parent
c6b198ce14
commit
c293b655f5
@ -852,6 +852,12 @@ BattleAction CPlayerInterface::activeStack(const CStack * stack) //called when i
|
||||
if (isAutoFightOn)
|
||||
{
|
||||
auto ret = autofightingAI->activeStack(stack);
|
||||
|
||||
if(cb->battleIsFinished())
|
||||
{
|
||||
return BattleAction::makeDefend(stack); // battle finished with spellcast
|
||||
}
|
||||
|
||||
if (isAutoFightOn)
|
||||
{
|
||||
return ret;
|
||||
@ -864,6 +870,11 @@ BattleAction CPlayerInterface::activeStack(const CStack * stack) //called when i
|
||||
|
||||
CBattleInterface *b = battleInt;
|
||||
|
||||
if(!b)
|
||||
{
|
||||
return BattleAction::makeDefend(stack); // probably battle is finished already
|
||||
}
|
||||
|
||||
if(CBattleInterface::givenCommand.get())
|
||||
{
|
||||
logGlobal->error("Command buffer must be clean! (we don't want to use old command)");
|
||||
|
Loading…
x
Reference in New Issue
Block a user