From 791d1e7ab479b0edb5ed81acbfb6b2e53521a41d Mon Sep 17 00:00:00 2001 From: ArseniyShestakov Date: Fri, 4 Dec 2015 05:30:43 +0300 Subject: [PATCH] VCAI: finish fixing of teleport probing for whirlpools --- AI/VCAI/VCAI.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/AI/VCAI/VCAI.cpp b/AI/VCAI/VCAI.cpp index bd0b195b4..e94b5e49a 100644 --- a/AI/VCAI/VCAI.cpp +++ b/AI/VCAI/VCAI.cpp @@ -1887,16 +1887,16 @@ bool VCAI::moveHeroToTile(int3 dst, HeroPtr h) auto doChannelProbing = [&]() -> void { - auto currentExit = getObj(CGHeroInstance::convertPosition(h->pos,false), false); - auto currentExitPos = CGHeroInstance::convertPosition(h->pos,false); - assert(currentExit); + auto currentPos = CGHeroInstance::convertPosition(h->pos,false); + auto currentExit = getObj(currentPos, true)->id; status.setChannelProbing(true); for(auto exit : teleportChannelProbingList) doTeleportMovement(exit, int3(-1)); teleportChannelProbingList.clear(); - doTeleportMovement(currentExit->id, currentExitPos); status.setChannelProbing(false); + + doTeleportMovement(currentExit, currentPos); }; int i=path.nodes.size()-1;