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

Remove false warning indicating something is wrong

This commit is contained in:
Dydzio 2019-05-19 12:22:41 +02:00
parent aee4bb7281
commit cd78779d9c
2 changed files with 5 additions and 3 deletions

View File

@ -792,8 +792,11 @@ void CBattleInterface::bSurrenderf()
if (cost >= 0)
{
std::string enemyHeroName = curInt->cb->battleGetEnemyHero().name;
if (enemyHeroName.empty())
enemyHeroName = "#ENEMY#"; //TODO: should surrendering without enemy hero be enabled?
if(enemyHeroName.empty())
{
logGlobal->warn("Surrender performed without enemy hero, should not happen!");
enemyHeroName = "#ENEMY#";
}
std::string surrenderMessage = boost::str(boost::format(CGI->generaltexth->allTexts[32]) % enemyHeroName % cost); //%s states: "I will accept your surrender and grant you and your troops safe passage for the price of %d gold."
curInt->showYesNoDialog(surrenderMessage, [this](){ reallySurrender(); }, nullptr);

View File

@ -241,7 +241,6 @@ InfoAboutHero CBattleInfoEssentials::battleGetHeroInfo(ui8 side) const
auto hero = getBattle()->getSideHero(side);
if(!hero)
{
logGlobal->warn("%s: side %d does not have hero!", __FUNCTION__, static_cast<int>(side));
return InfoAboutHero();
}
InfoAboutHero::EInfoLevel infoLevel = battleDoWeKnowAbout(side) ? InfoAboutHero::EInfoLevel::DETAILED : InfoAboutHero::EInfoLevel::BASIC;