1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-09-16 09:26:28 +02:00

Movement: initialize destinationTeleportPos with invalid int3 position

This commit is contained in:
ArseniyShestakov
2015-12-04 01:54:25 +03:00
parent ee08749743
commit 3800bd45b7
3 changed files with 7 additions and 7 deletions

View File

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

View File

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

View File

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