Browse Source

VCAI: use copy_if instead of erase_if for teleport exit probing list

ArseniyShestakov 10 years ago
parent
commit
8524bdbc25
1 changed files with 2 additions and 3 deletions
  1. 2 3
      AI/VCAI/VCAI.cpp

+ 2 - 3
AI/VCAI/VCAI.cpp

@@ -616,11 +616,10 @@ void VCAI::showTeleportDialog(TeleportChannelID channel, std::vector<ObjectInsta
 
 
 		if(!status.channelProbing())
 		if(!status.channelProbing())
 		{
 		{
-			vstd::erase_if(exits, [&](ObjectInstanceID id) -> bool
+			vstd::copy_if(exits, vstd::set_inserter(teleportChannelProbingList), [&](ObjectInstanceID id) -> bool
 			{
 			{
-				return vstd::contains(visitableObjs, cb->getObj(id)) || id == choosenExit;
+				return !(vstd::contains(visitableObjs, cb->getObj(id)) || id == choosenExit);
 			});
 			});
-			teleportChannelProbingList = exits;
 		}
 		}
 	}
 	}