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

Fixed remaining regressions

This commit is contained in:
Ivan Savenko
2023-04-19 17:38:25 +03:00
parent bb08a0afc8
commit 80b37a3019
5 changed files with 43 additions and 22 deletions

View File

@@ -313,6 +313,7 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details, bool verbose)
hero->convertToVisitablePos(details.end)
};
adventureInt->onMapTilesChanged(changedTiles);
adventureInt->onHeroMovementStarted(hero);
bool directlyAttackingCreature = details.attackedFrom && localState->hasPath(hero) && localState->getPath(hero).endPos() == *details.attackedFrom;
@@ -510,7 +511,8 @@ void CPlayerInterface::heroInGarrisonChange(const CGTownInstance *town)
if(town->garrisonHero) //wandering hero moved to the garrison
{
if(town->garrisonHero->tempOwner == playerID)
// This method also gets called on hero recruitment -> garrisoned hero is already in garrison
if(town->garrisonHero->tempOwner == playerID && !vstd::contains(localState->getWanderingHeroes(), town->visitingHero))
localState->removeWanderingHero(town->garrisonHero);
}