1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

Added convertToVisitablePos/convertFromVisitablePos to CGHeroInstance

This method replaces old convertPosition, but with more clear names and
without hardcoded magic constants.
This commit is contained in:
Ivan Savenko
2022-12-09 14:42:47 +02:00
parent 3e691d9033
commit 25bceda4ea
12 changed files with 47 additions and 36 deletions

View File

@ -489,7 +489,7 @@ void CHeroMovementQuery::onExposure(QueryPtr topQuery)
logGlobal->trace("Hero %s after victory over guard finishes visit to %s", hero->name, tmh.end.toString());
//finish movement
visitDestAfterVictory = false;
gh->visitObjectOnTile(*gh->getTile(tmh.end - hero->getVisitableOffset()), hero);
gh->visitObjectOnTile(*gh->getTile(hero->convertToVisitablePos(tmh.end)), hero);
}
owner->popIfTop(*this);