From eef45b5ae8fb299363fa99c3d0c695792c386f7c Mon Sep 17 00:00:00 2001 From: Ivan Savenko Date: Tue, 31 Mar 2015 00:55:37 +0300 Subject: [PATCH] Fixed warnings --- client/mapHandler.cpp | 2 +- lib/mapObjects/CommonConstructors.cpp | 2 +- lib/mapObjects/CommonConstructors.h | 2 +- lib/rmg/CMapGenerator.h | 2 +- lib/rmg/CRmgTemplateZone.cpp | 4 ++-- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/mapHandler.cpp b/client/mapHandler.cpp index da8d4e1d9..e5de71a13 100644 --- a/client/mapHandler.cpp +++ b/client/mapHandler.cpp @@ -678,7 +678,7 @@ void CMapHandler::CMapWorldViewBlitter::drawOverlayEx(SDL_Surface * targetSurf) for(const ObjectPosInfo & iconInfo : *(info->additionalIcons)) { - if(!iconInfo.pos.z == pos.z) + if( iconInfo.pos.z != pos.z) continue; if((iconInfo.pos.x < topTile.x) || (iconInfo.pos.y < topTile.y)) diff --git a/lib/mapObjects/CommonConstructors.cpp b/lib/mapObjects/CommonConstructors.cpp index 482aee331..1a119f9ed 100644 --- a/lib/mapObjects/CommonConstructors.cpp +++ b/lib/mapObjects/CommonConstructors.cpp @@ -377,7 +377,7 @@ TPossibleGuards CBankInfo::getPossibleGuards() const for (const JsonNode & configEntry : config) { const JsonNode & guardsInfo = configEntry["guards"]; - auto stacks = JsonRandom::evaluateCreatures(configEntry["guards"]); + auto stacks = JsonRandom::evaluateCreatures(guardsInfo); IObjectInfo::CArmyStructure army; diff --git a/lib/mapObjects/CommonConstructors.h b/lib/mapObjects/CommonConstructors.h index 99a4e268c..89dd0304d 100644 --- a/lib/mapObjects/CommonConstructors.h +++ b/lib/mapObjects/CommonConstructors.h @@ -162,7 +162,7 @@ public: TPossibleGuards getPossibleGuards() const; - //I have no idea what do these functions do or were supposed to do - War + // These functions should try to evaluate minimal possible/max possible guards to give provide information on possible thread to AI CArmyStructure minGuards() const; CArmyStructure maxGuards() const; diff --git a/lib/rmg/CMapGenerator.h b/lib/rmg/CMapGenerator.h index cbed27dcf..3d46a1c2d 100644 --- a/lib/rmg/CMapGenerator.h +++ b/lib/rmg/CMapGenerator.h @@ -96,7 +96,7 @@ private: CTileInfo*** tiles; int prisonsRemaining; - int questArtsRemaining; + //int questArtsRemaining; int monolithIndex; std::vector questArtifacts; diff --git a/lib/rmg/CRmgTemplateZone.cpp b/lib/rmg/CRmgTemplateZone.cpp index 78141c5d5..bf6e3de51 100644 --- a/lib/rmg/CRmgTemplateZone.cpp +++ b/lib/rmg/CRmgTemplateZone.cpp @@ -430,7 +430,7 @@ void CRmgTemplateZone::fractalize(CMapGenerator* gen) //the more treasure density, the greater distance between paths. Scaling is experimental. int totalDensity = 0; for (auto ti : treasureInfo) - totalDensity =+ ti.density; + totalDensity += ti.density; const float minDistance = 10 * 10; //squared for (auto tile : tileinfo) @@ -2239,7 +2239,7 @@ void CRmgTemplateZone::addAllPossibleObjects(CMapGenerator* gen) auto generateArtInfo = [this](ArtifactID id) -> ObjectInfo { ObjectInfo artInfo; - artInfo.probability = 1e6; //99,9% to spawn that art in first treasure pile + artInfo.probability = std::numeric_limits::max(); //99,9% to spawn that art in first treasure pile artInfo.maxPerZone = 1; artInfo.value = 2000; //treasure art artInfo.setTemplate(Obj::ARTIFACT, id, this->terrainType);