mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-23 22:37:55 +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:
@@ -1880,8 +1880,7 @@ void CGameState::placeHeroesInTowns()
|
||||
// assume that this hero should be visiting the town (H3M format quirk) and move hero to correct position
|
||||
if (heroOnTownBlockableTile)
|
||||
{
|
||||
int3 townVisitablePos = t->visitablePos();
|
||||
int3 correctedPos = townVisitablePos + h->getVisitableOffset();
|
||||
int3 correctedPos = h->convertFromVisitablePos(t->visitablePos());
|
||||
|
||||
map->removeBlockVisTiles(h);
|
||||
h->pos = correctedPos;
|
||||
|
||||
Reference in New Issue
Block a user