From b654ea831b2c2e411ffb37e077620f02c8182ab9 Mon Sep 17 00:00:00 2001 From: AlexVinS Date: Sat, 26 Jul 2014 10:12:45 +0400 Subject: [PATCH] [RMG] Fix mingw build, fix some warnings --- lib/rmg/CMapGenerator.cpp | 2 +- lib/rmg/CRmgTemplateZone.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/rmg/CMapGenerator.cpp b/lib/rmg/CMapGenerator.cpp index 7173fb665..3bc682a01 100644 --- a/lib/rmg/CMapGenerator.cpp +++ b/lib/rmg/CMapGenerator.cpp @@ -470,7 +470,7 @@ int CMapGenerator::getPrisonsRemaning() const } void CMapGenerator::decreasePrisonsRemaining() { - prisonsRemaining = std::max (0, prisonsRemaining--); + prisonsRemaining = std::max (0, prisonsRemaining - 1); } void CMapGenerator::registerZone (TFaction faction) diff --git a/lib/rmg/CRmgTemplateZone.cpp b/lib/rmg/CRmgTemplateZone.cpp index 0bc07c90a..ad99b5a5b 100644 --- a/lib/rmg/CRmgTemplateZone.cpp +++ b/lib/rmg/CRmgTemplateZone.cpp @@ -1159,7 +1159,7 @@ void CRmgTemplateZone::createObstacles(CMapGenerator* gen) { possibleObstacles.push_back (std::make_pair(o.first, o.second)); } - boost::sort (possibleObstacles, [](obstaclePair &p1, obstaclePair &p2) -> bool + boost::sort (possibleObstacles, [](const obstaclePair &p1, const obstaclePair &p2) -> bool { return p1.first > p2.first; //bigger obstacles first }); @@ -1184,7 +1184,7 @@ void CRmgTemplateZone::createObstacles(CMapGenerator* gen) for (auto tile : boost::adaptors::reverse(tileinfo)) { //fill tiles that should be blocked with obstacles or are just possible (with some probability) - if (gen->shouldBeBlocked(tile) || gen->isPossible(tile) && gen->rand.nextInt(1,100) < 60) + if (gen->shouldBeBlocked(tile) || (gen->isPossible(tile) && gen->rand.nextInt(1,100) < 60)) { //start from biggets obstacles for (int i = 0; i < possibleObstacles.size(); i++) @@ -1967,4 +1967,4 @@ void CRmgTemplateZone::addAllPossibleObjects (CMapGenerator* gen) void ObjectInfo::setTemplate (si32 type, si32 subtype, ETerrainType terrainType) { templ = VLC->objtypeh->getHandlerFor(type, subtype)->getTemplates(terrainType).front(); -} \ No newline at end of file +}