mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-25 22:42:04 +02:00
* adventure map GUI should be properly blocked during AI turn
* battle window will wait till all dialogs are closed * fixed problems with AI working after the game ended * fixed problems with overzealous redrawing of infobar
This commit is contained in:
@@ -469,8 +469,7 @@ void VCAI::gameOver(ui8 player, bool victory)
|
||||
*(int*)NULL = 666;
|
||||
}
|
||||
|
||||
if(makingTurn)
|
||||
makingTurn->interrupt();
|
||||
finish();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1257,10 +1256,10 @@ bool VCAI::moveHeroToTile(int3 dst, const CGHeroInstance * h)
|
||||
//tlog0 << "Moving " << h->name << " from " << h->getPosition() << " to " << endpos << std::endl;
|
||||
cb->moveHero(h,CGHeroInstance::convertPosition(endpos, true));
|
||||
waitTillFree(); //movement may cause battle or blocking dialog
|
||||
boost::this_thread::interruption_point();
|
||||
if(h->tempOwner != playerID) //we lost hero
|
||||
break;
|
||||
|
||||
boost::this_thread::interruption_point();
|
||||
}
|
||||
ret = !i;
|
||||
}
|
||||
@@ -1662,6 +1661,12 @@ void VCAI::recruitHero(const CGTownInstance * t)
|
||||
cb->recruitHero(t, cb->getAvailableHeroes(t).front());
|
||||
}
|
||||
|
||||
void VCAI::finish()
|
||||
{
|
||||
if(makingTurn)
|
||||
makingTurn->interrupt();
|
||||
}
|
||||
|
||||
AIStatus::AIStatus()
|
||||
{
|
||||
battle = NO_BATTLE;
|
||||
|
||||
Reference in New Issue
Block a user