Browse Source

VCAI: dont visit border guard if tent not visited. Fix issue 1590

CQuest::checkQuest cant be used for border guard since CGKeys not yet work using quests.
Currently border guard have MISSION_NONE quest that always return true and make AI stuck.
Arseniy Shestakov 9 years ago
parent
commit
5778082842
1 changed files with 1 additions and 0 deletions
  1. 1 0
      AI/VCAI/VCAI.cpp

+ 1 - 0
AI/VCAI/VCAI.cpp

@@ -3140,6 +3140,7 @@ bool shouldVisit(HeroPtr h, const CGObjectInstance * obj)
 		}
 		}
 			break;
 			break;
 		case Obj::BORDERGUARD: //open borderguard if possible
 		case Obj::BORDERGUARD: //open borderguard if possible
+			return (dynamic_cast <const CGKeys *>(obj))->wasMyColorVisited(ai->playerID);
 		case Obj::SEER_HUT:
 		case Obj::SEER_HUT:
 		case Obj::QUEST_GUARD:
 		case Obj::QUEST_GUARD:
 		{
 		{