From cd78779d9c3bc2598f797462d283e0df8c33c8d2 Mon Sep 17 00:00:00 2001 From: Dydzio Date: Sun, 19 May 2019 12:22:41 +0200 Subject: [PATCH] Remove false warning indicating something is wrong --- client/battle/CBattleInterface.cpp | 7 +++++-- lib/battle/CBattleInfoEssentials.cpp | 1 - 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/client/battle/CBattleInterface.cpp b/client/battle/CBattleInterface.cpp index 75d1bd0ec..11c092b4a 100644 --- a/client/battle/CBattleInterface.cpp +++ b/client/battle/CBattleInterface.cpp @@ -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); diff --git a/lib/battle/CBattleInfoEssentials.cpp b/lib/battle/CBattleInfoEssentials.cpp index ba8a9202c..366d19bca 100644 --- a/lib/battle/CBattleInfoEssentials.cpp +++ b/lib/battle/CBattleInfoEssentials.cpp @@ -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(side)); return InfoAboutHero(); } InfoAboutHero::EInfoLevel infoLevel = battleDoWeKnowAbout(side) ? InfoAboutHero::EInfoLevel::DETAILED : InfoAboutHero::EInfoLevel::BASIC;