소스 검색

Little bugfix in hero picking.

Michał W. Urbańczyk 18 년 전
부모
커밋
85e45df6d1
1개의 변경된 파일3개의 추가작업 그리고 3개의 파일을 삭제
  1. 3 3
      mapHandler.cpp

+ 3 - 3
mapHandler.cpp

@@ -40,14 +40,14 @@ void alphaTransformDef(CGDefInfo * defInfo)
 }
 int CMapHandler::pickHero(int owner)
 {
-	if(usedHeroes.find(CGI->scenarioOps.getIthPlayersSettings(owner).hero)==usedHeroes.end()) //we haven't used selected hero
+	int h;
+	if(usedHeroes.find(h = CGI->scenarioOps.getIthPlayersSettings(owner).hero)==usedHeroes.end() && h>=0) //we haven't used selected hero
 	{
-		int h = CGI->scenarioOps.getIthPlayersSettings(owner).hero;
 		usedHeroes.insert(h);
 		return h;
 	}
 	int f = CGI->scenarioOps.getIthPlayersSettings(owner).castle;
-	int i=0, h;
+	int i=0;
 	do //try to find free hero of our faction
 	{
 		i++;