1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-23 00:28:08 +02:00

Removed CGHeroInstance::getPosition pseudo-override

Now access to hero visible position is always done via visitablePos
This commit is contained in:
Ivan Savenko
2022-12-07 22:10:08 +02:00
parent 2855606a88
commit 908e6892f3
10 changed files with 13 additions and 28 deletions

View File

@ -294,7 +294,7 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
if(gs->curB && gs->curB->playerHasAccessToHeroInfo(*player, h)) //if it's battle we can get enemy hero full data
infoLevel = InfoAboutHero::EInfoLevel::INBATTLE;
else
ERROR_RET_VAL_IF(!isVisible(h->getPosition(false)), "That hero is not visible!", false);
ERROR_RET_VAL_IF(!isVisible(h->visitablePos()), "That hero is not visible!", false);
}
if( (infoLevel == InfoAboutHero::EInfoLevel::BASIC) && nullptr != selectedObject)
@ -734,7 +734,7 @@ std::vector < const CGHeroInstance *> CPlayerSpecificInfoCallback::getHeroesInfo
{
// !player || // - why would we even get access to hero not owned by any player?
if((hero->tempOwner == *player) ||
(isVisible(hero->getPosition(false), player) && !onlyOur) )
(isVisible(hero->visitablePos(), player) && !onlyOur) )
{
ret.push_back(hero);
}