mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Removed CGHeroInstance::convertPosition method
This commit is contained in:
@ -264,8 +264,8 @@ void CPlayerInterface::heroMoved(const TryMoveHero & details, bool verbose)
|
||||
assert(adventureInt->terrain.currentPath->nodes.size() >= 2);
|
||||
std::vector<CGPathNode>::const_iterator nodesIt = adventureInt->terrain.currentPath->nodes.end() - 1;
|
||||
|
||||
if((nodesIt)->coord == hero->convertPosition(details.start, false)
|
||||
&& (nodesIt - 1)->coord == hero->convertPosition(details.end, false))
|
||||
if((nodesIt)->coord == details.start - hero->getVisitableOffset()
|
||||
&& (nodesIt - 1)->coord == details.end - hero->getVisitableOffset())
|
||||
{
|
||||
//path was between entrance and exit of teleport -> OK, erase node as usual
|
||||
removeLastNodeFromPath(hero);
|
||||
@ -2405,7 +2405,7 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path)
|
||||
int i = 1;
|
||||
auto getObj = [&](int3 coord, bool ignoreHero)
|
||||
{
|
||||
return cb->getTile(h->convertPosition(coord,false))->topVisitableObj(ignoreHero);
|
||||
return cb->getTile(coord - h->getVisitableOffset())->topVisitableObj(ignoreHero);
|
||||
};
|
||||
|
||||
auto isTeleportAction = [&](CGPathNode::ENodeAction action) -> bool
|
||||
@ -2445,7 +2445,7 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path)
|
||||
|
||||
{
|
||||
for (auto & elem : path.nodes)
|
||||
elem.coord = h->convertPosition(elem.coord,true);
|
||||
elem.coord = elem.coord + h->getVisitableOffset();
|
||||
|
||||
TerrainId currentTerrain = Terrain::BORDER; // not init yet
|
||||
TerrainId newTerrain;
|
||||
@ -2503,7 +2503,7 @@ void CPlayerInterface::doMoveHero(const CGHeroInstance * h, CGPath path)
|
||||
sh = CCS->soundh->playSound(soundBase::horseFlying, -1);
|
||||
#endif
|
||||
{
|
||||
newTerrain = cb->getTile(h->convertPosition(currentCoord, false))->terType->id;
|
||||
newTerrain = cb->getTile(currentCoord - h->getVisitableOffset())->terType->id;
|
||||
if(newTerrain != currentTerrain)
|
||||
{
|
||||
CCS->soundh->stopSound(sh);
|
||||
|
Reference in New Issue
Block a user