Skip to content

Commit

Permalink
Merge pull request #76 from Fayth/mantis-2016
Browse files Browse the repository at this point in the history
Looks much better now :)
  • Loading branch information
DjWarmonger authored and DjWarmonger committed Jan 25, 2015
2 parents 6120b2e + 551925b commit 86fde2b
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion client/CPreGame.cpp
Expand Up @@ -2317,7 +2317,10 @@ void OptionsTab::nextCastle( PlayerColor player, int dir )
}

if(s.hero >= 0 && !SEL->current->mapHeader->players[s.color.getNum()].hasCustomMainHero()) // remove hero unless it set to fixed one in map editor
{
usedHeroes.erase(s.hero); // restore previously selected hero back to available pool
s.hero = PlayerSettings::RANDOM;
}
if(cur < 0 && s.bonus == PlayerSettings::RESOURCE)
s.bonus = PlayerSettings::RANDOM;

Expand Down Expand Up @@ -2352,7 +2355,7 @@ void OptionsTab::nextHero( PlayerColor player, int dir )
if(dir > 0)
s.hero = nextAllowedHero(player, s.hero, CGI->heroh->heroes.size(), 1, dir);
else
s.hero = nextAllowedHero(player, 0, s.hero, 1, dir);
s.hero = nextAllowedHero(player, -1, s.hero, 1, dir); // min needs to be -1 -- hero at index 0 would be skipped otherwise
}

if(old != s.hero)
Expand Down Expand Up @@ -2530,6 +2533,7 @@ void OptionsTab::flagPressed( PlayerColor color )
usedHeroes.erase(old->hero);

old->hero = entries[old->color]->pi.defaultHero();
entries[old->color]->update(); // update previous frame images in case entries were auto-updated
}

SEL->propagateOptions();
Expand Down

0 comments on commit 86fde2b

Please sign in to comment.