mirror of
https://github.com/vcmi/vcmi.git
synced 2025-02-15 13:33:36 +02:00
Merge pull request #1103 from Nordsoft91/autobattle-bugfix
Preventing multiple AI from being created
This commit is contained in:
commit
c5cf0e4086
@ -859,17 +859,17 @@ void CBattleInterface::reallySurrender()
|
|||||||
|
|
||||||
void CBattleInterface::bAutofightf()
|
void CBattleInterface::bAutofightf()
|
||||||
{
|
{
|
||||||
if (spellDestSelectMode) //we are casting a spell
|
if(spellDestSelectMode) //we are casting a spell
|
||||||
return;
|
return;
|
||||||
|
|
||||||
//Stop auto-fight mode
|
//Stop auto-fight mode
|
||||||
if (curInt->isAutoFightOn)
|
if(curInt->isAutoFightOn)
|
||||||
{
|
{
|
||||||
assert(curInt->autofightingAI);
|
assert(curInt->autofightingAI);
|
||||||
curInt->isAutoFightOn = false;
|
curInt->isAutoFightOn = false;
|
||||||
logGlobal->trace("Stopping the autofight...");
|
logGlobal->trace("Stopping the autofight...");
|
||||||
}
|
}
|
||||||
else
|
else if(!curInt->autofightingAI)
|
||||||
{
|
{
|
||||||
curInt->isAutoFightOn = true;
|
curInt->isAutoFightOn = true;
|
||||||
blockUI(true);
|
blockUI(true);
|
||||||
@ -1619,7 +1619,9 @@ void CBattleInterface::activateStack()
|
|||||||
|
|
||||||
setActiveStack(stackToActivate);
|
setActiveStack(stackToActivate);
|
||||||
stackToActivate = nullptr;
|
stackToActivate = nullptr;
|
||||||
const CStack *s = activeStack;
|
const CStack * s = activeStack;
|
||||||
|
if(!s)
|
||||||
|
return;
|
||||||
|
|
||||||
queue->update();
|
queue->update();
|
||||||
redrawBackgroundWithHexes(activeStack);
|
redrawBackgroundWithHexes(activeStack);
|
||||||
|
@ -536,6 +536,8 @@ void CMapHandler::CMapWorldViewBlitter::drawTileOverlay(SDL_Surface * targetSurf
|
|||||||
for(auto & object : objects)
|
for(auto & object : objects)
|
||||||
{
|
{
|
||||||
const CGObjectInstance * obj = object.obj;
|
const CGObjectInstance * obj = object.obj;
|
||||||
|
if(!obj)
|
||||||
|
continue;
|
||||||
|
|
||||||
const bool sameLevel = obj->pos.z == pos.z;
|
const bool sameLevel = obj->pos.z == pos.z;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user