1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-29 23:07:48 +02:00

Workaround for hero & town issue. Game still crashes elsewhere, though.

This commit is contained in:
DjWarmonger
2014-07-01 12:07:53 +02:00
parent dc98f14884
commit bae9f2083f
4 changed files with 24 additions and 8 deletions

View File

@@ -523,7 +523,14 @@ void CGTownInstance::onHeroVisit(const CGHeroInstance * h) const
void CGTownInstance::onHeroLeave(const CGHeroInstance * h) const
{
cb->stopHeroVisitCastle(this, h);
//FIXME: find out why this issue appears on random maps
if (visitingHero == h)
{
cb->stopHeroVisitCastle(this, h);
logGlobal->warnStream() << h->name << " correctly left town " << name;
}
else
logGlobal->warnStream() << "Warning, " << h->name << " tries to leave the town " << name << " but hero is not inside.";
}
std::string CGTownInstance::getObjectName() const