1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +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

@ -2008,7 +2008,7 @@ CGPath * CPlayerInterface::getAndVerifyPath(const CGHeroInstance * h)
}
else
{
assert(h->getPosition(false) == path.startPos());
assert(h->visitablePos() == path.startPos());
//update the hero path in case of something has changed on map
if (LOCPLINT->cb->getPathsInfo(h)->getPath(path, path.endPos()))
return &path;
@ -2112,7 +2112,7 @@ void CPlayerInterface::acceptTurn()
void CPlayerInterface::tryDiggging(const CGHeroInstance * h)
{
int msgToShow = -1;
const bool isBlocked = CGI->mh->hasObjectHole(h->getPosition(false)); // Don't dig in the pit.
const bool isBlocked = CGI->mh->hasObjectHole(h->visitablePos()); // Don't dig in the pit.
const auto diggingStatus = isBlocked
? EDiggingStatus::TILE_OCCUPIED