1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-12-24 22:14:36 +02:00

Merge pull request #76 from Fayth/mantis-2016

Looks much better now :)
This commit is contained in:
DjWarmonger 2015-01-25 07:49:46 +01:00
commit 86fde2ba54

View File

@ -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;
@ -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)
@ -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();