Преглед изворни кода

Merge pull request #959 from kambala-decapitator/fix-cursor-attack

fix cursor image on hover when there're multiple creatures nearby
Andrii Danylchenko пре 3 година
родитељ
комит
127a7e6653
2 измењених фајлова са 2 додато и 3 уклоњено
  1. 1 2
      client/windows/CAdvmapInterface.cpp
  2. 1 1
      lib/CPathfinder.cpp

+ 1 - 2
client/windows/CAdvmapInterface.cpp

@@ -1711,8 +1711,7 @@ void CAdvMapInt::tileHovered(const int3 &mapPos)
 	}
 	else if(const CGHeroInstance * h = curHero())
 	{
-		int3 mapPosCopy = mapPos;
-		const CGPathNode * pnode = LOCPLINT->cb->getPathsInfo(h)->getPathInfo(mapPosCopy);
+		const CGPathNode * pnode = LOCPLINT->cb->getPathsInfo(h)->getPathInfo(mapPos);
 		assert(pnode);
 
 		int turns = pnode->turns;

+ 1 - 1
lib/CPathfinder.cpp

@@ -903,7 +903,7 @@ CGPathNode::ENodeAction CPathfinder::getTeleportDestAction() const
 
 bool CPathfinder::isDestinationGuardian() const
 {
-	return gs->guardingCreaturePosition(source.node->coord) == destination.node->coord;
+	return gs->guardingCreaturePosition(destination.node->coord) == destination.node->coord;
 }
 
 void CPathfinderHelper::initializePatrol()