From 3800bd45b7f03396412ccfdff88d677efbdc8270 Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Fri, 4 Dec 2015 01:54:25 +0300 Subject: [PATCH] Movement: initialize destinationTeleportPos with invalid int3 position --- AI/VCAI/VCAI.cpp | 8 ++++---- AI/VCAI/VCAI.h | 2 +- client/CPlayerInterface.cpp | 4 ++-- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index cf99d0697..bd0b195b4 100644 --- a/AI/VCAI/VCAI.cpp +++ b/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 lock(mx); - ongoingHeroMovement = ongoing; + ongoingChannelProbing = ongoing; cv.notify_all(); } diff --git a/AI/VCAI/VCAI.h b/AI/VCAI/VCAI.h index aa5eb521b..25eb312cd 100644 --- a/AI/VCAI/VCAI.h +++ b/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; diff --git a/client/CPlayerInterface.cpp b/client/CPlayerInterface.cpp index 6132d8035..089d94b88 100644 --- a/client/CPlayerInterface.cpp +++ b/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); } }