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:
@ -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()
|
||||
|
Reference in New Issue
Block a user