1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Warnings fixes (#538)

Warnings fixes
* Suppress `missing-braces` for Clang
* Fixed many C4275 warnings
* Fixed almost all Clang/GCC warnings
* Silence most frequent MSVC warning.
* Fixed some pessimizing-move warnings
* Fixed some unused capture warnings
This commit is contained in:
Alexander Shishkin
2019-01-19 13:52:02 +03:00
committed by GitHub
parent 419fee1fb2
commit b00e935e4d
34 changed files with 67 additions and 71 deletions

View File

@@ -302,14 +302,12 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
//DISGUISED bonus implementation
bool disguiseFlag = (infoLevel == InfoAboutHero::EInfoLevel::DETAILED);
if(getPlayerRelations(getLocalPlayer(), hero->tempOwner) == PlayerRelations::ENEMIES)
{
//todo: bonus cashing
int disguiseLevel = h->valOfBonuses(Selector::typeSubtype(Bonus::DISGUISED, 0));
auto doBasicDisguise = [disguiseLevel](InfoAboutHero & info)
auto doBasicDisguise = [](InfoAboutHero & info)
{
int maxAIValue = 0;
const CCreature * mostStrong = nullptr;
@@ -332,7 +330,7 @@ bool CGameInfoCallback::getHeroInfo(const CGObjectInstance * hero, InfoAboutHero
}
};
auto doAdvancedDisguise = [disguiseFlag, &doBasicDisguise](InfoAboutHero & info)
auto doAdvancedDisguise = [&doBasicDisguise](InfoAboutHero & info)
{
doBasicDisguise(info);