1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-01 00:45:26 +02:00

Get rid of some old serialization workaround code that is not needed because serializer was improved in the meantime.

Fixing #1254.
Fixed possible race causing corruption of the server savegame.
This commit is contained in:
Michał W. Urbańczyk
2013-04-20 18:44:55 +00:00
parent 87988b0ae7
commit d1d67caa0b
6 changed files with 24 additions and 91 deletions

View File

@ -2174,7 +2174,7 @@ void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
cb->heroVisitCastle(this, h);
}
}
else
else if(h->visitablePos() == visitablePos())
{
if (h->commander && !h->commander->alive) //rise commander. TODO: interactive script
{
@ -2186,6 +2186,10 @@ void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
}
cb->heroVisitCastle(this, h);
}
else
{
logGlobal->errorStream() << h->name << " visits allied town of " << name << " from different pos?";
}
}
void CGTownInstance::onHeroLeave(const CGHeroInstance * h) const
@ -2433,10 +2437,13 @@ std::string CGTownInstance::nodeName() const
void CGTownInstance::deserializationFix()
{
attachTo(&townAndVis);
if(visitingHero)
visitingHero->attachTo(&townAndVis);
if(garrisonHero)
garrisonHero->attachTo(this);
//Hero is already handled by CGameState::attachArmedObjects
// if(visitingHero)
// visitingHero->attachTo(&townAndVis);
// if(garrisonHero)
// garrisonHero->attachTo(this);
}
void CGTownInstance::recreateBuildingsBonuses()