1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix regressions

This commit is contained in:
Ivan Savenko
2023-04-17 23:16:45 +03:00
parent dd227d24c3
commit e8718a46cc
4 changed files with 42 additions and 79 deletions

View File

@@ -515,7 +515,8 @@ void CPlayerInterface::heroInGarrisonChange(const CGTownInstance *town)
if(town->visitingHero) //hero leaves garrison
{
if(town->visitingHero->tempOwner == playerID)
// This method also gets called on hero recruitment -> wandering heroes already contains new hero
if(town->visitingHero->tempOwner == playerID && !vstd::contains(localState->getWanderingHeroes(), town->visitingHero))
localState->addWanderingHero(town->visitingHero);
}
adventureInt->onHeroChanged(nullptr);
@@ -1255,8 +1256,8 @@ void CPlayerInterface::moveHero( const CGHeroInstance *h, const CGPath& path )
setMovementStatus(true);
if (adventureInt)
adventureInt->onHeroWokeUp(h);
if (localState->isHeroSleeping(h))
localState->setHeroAwaken(h);
boost::thread moveHeroTask(std::bind(&CPlayerInterface::doMoveHero,this,h,path));
}