1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +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

@ -552,7 +552,7 @@ void GarrisonDialog::applyCl(CClient *cl)
if(!vstd::contains(cl->playerint,h->getOwner()))
return;
boost::function<void()> callback = boost::bind(&CCallback::selectionMade,LOCPLINT->cb,0,id);
boost::function<void()> callback = boost::bind(&CCallback::selectionMade,cl->callbacks[h->getOwner()].get(),0,id);
cl->playerint[h->getOwner()]->showGarrisonDialog(obj,h,removableUnits,callback);
}

View File

@ -6291,7 +6291,7 @@ void CGSirens::onHeroVisit( const CGHeroInstance * h ) const
xp = h->calculateXp(xp);
iw.text.addTxt(11,132);
iw.text.addReplacement(xp);
cb->changePrimSkill(h->ID, 4, xp, false);
cb->changePrimSkill(h->id, 4, xp, false);
}
else
{

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;

View File

@ -242,8 +242,8 @@ public:
void ask(Query * sel, ui8 player, const CFunctionList<void(ui32)> &callback);
void sendToAllClients(CPackForClient * info);
void sendAndApply(CPackForClient * info);
void applyAndSend(CPackForClient * info);
void sendAndApply(CGarrisonOperationPack * info);
//void sendAndApply(SetGarrisons * info);
void sendAndApply(SetResource * info);
void sendAndApply(SetResources * info);
void sendAndApply(NewStructures * info);