1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-07-15 01:24:45 +02:00

- handling of incorrect or missing configuration files (settings.json\defaultSettings.json)

- better code for recruitment window, fixes #1013
- minor tweak to adv.map classes
This commit is contained in:
Ivan Savenko
2012-06-22 11:40:16 +00:00
parent 933049ee91
commit 770a6e077c
10 changed files with 328 additions and 183 deletions

View File

@ -247,7 +247,7 @@ void CHeroList::update(const CGHeroInstance * hero)
for (auto iter = list->getItems().begin(); iter != list->getItems().end(); iter++)
{
auto item = dynamic_cast<CHeroItem*>(*iter);
if (item && item->hero == hero)
if (item && item->hero == hero && vstd::contains(LOCPLINT->wanderingHeroes, hero))
{
item->update();
return;
@ -817,13 +817,13 @@ void CInfoBar::showSelection()
auto hero = dynamic_cast<const CGHeroInstance *>(adventureInt->selection);
if (hero)
{
showHeroSelection(hero, false);
showHeroSelection(hero);
return;
}
auto town = dynamic_cast<const CGTownInstance *>(adventureInt->selection);
if (town)
{
showTownSelection(town, false);
showTownSelection(town);
return;
}
}
@ -903,7 +903,7 @@ void CInfoBar::updateEnemyTurn(double progress)
redraw();
}
void CInfoBar::showHeroSelection(const CGHeroInstance * hero, bool onlyUpdate)
void CInfoBar::showHeroSelection(const CGHeroInstance * hero)
{
if (!hero)
return;
@ -914,7 +914,7 @@ void CInfoBar::showHeroSelection(const CGHeroInstance * hero, bool onlyUpdate)
redraw();
}
void CInfoBar::showTownSelection(const CGTownInstance * town, bool onlyUpdate)
void CInfoBar::showTownSelection(const CGTownInstance * town)
{
if (!town)
return;