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

Movement: initialize destinationTeleportPos with invalid int3 position

ArseniyShestakov пре 10 година
родитељ
комит
3800bd45b7
3 измењених фајлова са 7 додато и 7 уклоњено
  1. 4 4
      AI/VCAI/VCAI.cpp
  2. 1 1
      AI/VCAI/VCAI.h
  3. 2 2
      client/CPlayerInterface.cpp

+ 4 - 4
AI/VCAI/VCAI.cpp

@@ -96,7 +96,7 @@ VCAI::VCAI(void)
 	LOG_TRACE(logAi);
 	makingTurn = nullptr;
 	destinationTeleport = ObjectInstanceID();
-	destinationTeleportPos = int3();
+	destinationTeleportPos = int3(-1);
 }
 
 VCAI::~VCAI(void)
@@ -1881,7 +1881,7 @@ bool VCAI::moveHeroToTile(int3 dst, HeroPtr h)
 				destinationTeleportPos = CGHeroInstance::convertPosition(exitPos, true);
 			cb->moveHero(*h, h->pos);
 			destinationTeleport = ObjectInstanceID();
-			destinationTeleportPos = int3();
+			destinationTeleportPos = int3(-1);
 			afterMovementCheck();
 		};
 
@@ -1893,7 +1893,7 @@ bool VCAI::moveHeroToTile(int3 dst, HeroPtr h)
 
 			status.setChannelProbing(true);
 			for(auto exit : teleportChannelProbingList)
-				doTeleportMovement(exit, int3());
+				doTeleportMovement(exit, int3(-1));
 			teleportChannelProbingList.clear();
 			doTeleportMovement(currentExit->id, currentExitPos);
 			status.setChannelProbing(false);
@@ -2931,7 +2931,7 @@ void AIStatus::setMove(bool ongoing)
 void AIStatus::setChannelProbing(bool ongoing)
 {
 	boost::unique_lock<boost::mutex> lock(mx);
-	ongoingHeroMovement = ongoing;
+	ongoingChannelProbing = ongoing;
 	cv.notify_all();
 }
 

+ 1 - 1
AI/VCAI/VCAI.h

@@ -367,7 +367,7 @@ public:
 		}
 		else if(!h.saving)
 		{
-			destinationTeleportPos = int3();
+			destinationTeleportPos = int3(-1);
 		}
 		h & townVisitsThisWeek & lockedHeroes & reservedHeroesMap; //FIXME: cannot instantiate abstract class
 		h & visitableObjs & alreadyVisited & reservedObjs;

+ 2 - 2
client/CPlayerInterface.cpp

@@ -97,7 +97,7 @@ CPlayerInterface::CPlayerInterface(PlayerColor Player)
 {
 	logGlobal->traceStream() << "\tHuman player interface for player " << Player << " being constructed";
 	destinationTeleport = ObjectInstanceID();
-	destinationTeleportPos = int3();
+	destinationTeleportPos = int3(-1);
 	observerInDuelMode = false;
 	howManyPeople++;
 	GH.defActionsDef = 0;
@@ -1416,7 +1416,7 @@ void CPlayerInterface::requestRealized( PackageApplied *pa )
 	   && stillMoveHero.get() == DURING_MOVE)
 	{ // After teleportation via CGTeleport object is finished
 		destinationTeleport = ObjectInstanceID();
-		destinationTeleportPos = int3();
+		destinationTeleportPos = int3(-1);
 		stillMoveHero.setn(CONTINUE_MOVE);
 	}
 }