1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-01-12 02:28:11 +02:00

Fix garrisons hero

This commit is contained in:
nordsoft 2023-05-02 15:09:02 +04:00
parent 7996123dfa
commit 92dcfd1f68
2 changed files with 3 additions and 3 deletions

View File

@ -444,7 +444,7 @@ void CTownRewardableBuilding::onHeroVisit(const CGHeroInstance *h) const
cb->showBlockingDialog(&sd);
};
if(!town->hasBuilt(bID))
if(!town->hasBuilt(bID) || cb->isVisitCoveredByAnotherQuery(town, h))
return;
if(!wasVisitedBefore(h))
@ -496,7 +496,7 @@ void CTownRewardableBuilding::onHeroVisit(const CGHeroInstance *h) const
if (!visitedRewards.empty())
grantRewardWithMessage(visitedRewards[0]);
else
logMod->warn("No applicable message for visiting already visited object!");
logMod->debug("No applicable message for visiting already visited object!");
}
}

View File

@ -3614,7 +3614,7 @@ bool CGameHandler::buildStructure(ObjectInstanceID tid, BuildingID requestedID,
if(t->visitingHero)
objectVisited(t, t->visitingHero);
if(t->garrisonHero)
objectVisited(t, t->garrisonHero);
visitCastleObjects(t, t->garrisonHero);
checkVictoryLossConditionsForPlayer(t->tempOwner);
return true;