1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

* fixed crash on visiting Sirens

* fixed race condition on the new turn,  #729 should be gone
* fixed crashes in AI-only game mode
This commit is contained in:
Michał W. Urbańczyk
2011-09-06 09:59:06 +00:00
parent 8c7f574b01
commit bb1bdcb0a7
4 changed files with 12 additions and 6 deletions

View File

@ -1244,7 +1244,7 @@ void CGameHandler::run(bool resume)
{
YourTurn yt;
yt.player = i->first;
sendAndApply(&yt);
applyAndSend(&yt);
}
//wait till turn is done
@ -1939,13 +1939,18 @@ void CGameHandler::sendToAllClients( CPackForClient * info )
}
}
void CGameHandler::sendAndApply( CPackForClient * info )
void CGameHandler::sendAndApply(CPackForClient * info)
{
//TODO? mutex
sendToAllClients(info);
gs->apply(info);
}
void CGameHandler::applyAndSend(CPackForClient * info)
{
gs->apply(info);
sendToAllClients(info);
}
void CGameHandler::sendAndApply(CGarrisonOperationPack * info)
{
sendAndApply((CPackForClient*)info);
@ -5231,6 +5236,7 @@ void CGameHandler::spawnWanderingMonsters(int creatureID)
tiles.erase(tile); //not use it again
}
}
CasualtiesAfterBattle::CasualtiesAfterBattle(const CArmedInstance *army, BattleInfo *bat)
{
int color = army->tempOwner;