1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-13 01:20:34 +02:00

Little bugfix in hero picking.

This commit is contained in:
Michał W. Urbańczyk
2008-02-10 12:57:56 +00:00
parent ec072972ee
commit 85e45df6d1

View File

@ -40,14 +40,14 @@ void alphaTransformDef(CGDefInfo * defInfo)
} }
int CMapHandler::pickHero(int owner) 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); usedHeroes.insert(h);
return h; return h;
} }
int f = CGI->scenarioOps.getIthPlayersSettings(owner).castle; int f = CGI->scenarioOps.getIthPlayersSettings(owner).castle;
int i=0, h; int i=0;
do //try to find free hero of our faction do //try to find free hero of our faction
{ {
i++; i++;