浏览代码

Little bugfix in hero picking.

Michał W. Urbańczyk 17 年之前
父节点
当前提交
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++;