ソースを参照

VCAI: finish fixing of teleport probing for whirlpools

ArseniyShestakov 10 年 前
コミット
791d1e7ab4
1 ファイル変更4 行追加4 行削除
  1. 4 4
      AI/VCAI/VCAI.cpp

+ 4 - 4
AI/VCAI/VCAI.cpp

@@ -1887,16 +1887,16 @@ bool VCAI::moveHeroToTile(int3 dst, HeroPtr h)
 
 
 		auto doChannelProbing = [&]() -> void
 		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);
 			status.setChannelProbing(true);
 			for(auto exit : teleportChannelProbingList)
 			for(auto exit : teleportChannelProbingList)
 				doTeleportMovement(exit, int3(-1));
 				doTeleportMovement(exit, int3(-1));
 			teleportChannelProbingList.clear();
 			teleportChannelProbingList.clear();
-			doTeleportMovement(currentExit->id, currentExitPos);
 			status.setChannelProbing(false);
 			status.setChannelProbing(false);
+
+			doTeleportMovement(currentExit, currentPos);
 		};
 		};
 
 
 		int i=path.nodes.size()-1;
 		int i=path.nodes.size()-1;