1
0
mirror of https://github.com/vcmi/vcmi.git synced 2024-11-28 08:48:48 +02:00

Gcc compile & warning fixes

This commit is contained in:
Ivan Savenko 2014-06-22 17:26:08 +03:00
parent 3ac306f501
commit c605e2d10c
3 changed files with 18 additions and 8 deletions

View File

@ -10,10 +10,10 @@
#include "StdInc.h"
#include "CGTownInstance.h"
#include "CObjectClassesHandler.h"
#include "../NetPacks.h"
#include "../CGeneralTextHandler.h"
#include "../mapObjects/CObjectClassesHandler.h"
using namespace boost::assign;

View File

@ -237,7 +237,7 @@ void CMapGenerator::createConnections()
int3 guardPos(-1,-1,-1);
auto otherZoneTiles = zoneB->getTileInfo();
auto otherZoneCenter = zoneB->getPos();
//auto otherZoneCenter = zoneB->getPos();
for (auto tile : tiles)
{

View File

@ -20,6 +20,8 @@
#include "../CSpellHandler.h" //for choosing random spells
#include "../mapObjects/CObjectClassesHandler.h"
#include "../mapObjects/CGPandoraBox.h"
#include "../mapObjects/CRewardableObject.h"
class CMap;
class CMapEditManager;
@ -122,9 +124,16 @@ void CTileInfo::setTerrainType(ETerrainType value)
terrain = value;
}
CRmgTemplateZone::CRmgTemplateZone() : id(0), type(ETemplateZoneType::PLAYER_START), size(1),
terrainType (ETerrainType::GRASS), townType(0), townsAreSameType(false), matchTerrainToTown(true), totalDensity(0),
zoneMonsterStrength(EMonsterStrength::ZONE_NORMAL)
CRmgTemplateZone::CRmgTemplateZone() :
id(0),
type(ETemplateZoneType::PLAYER_START),
size(1),
townsAreSameType(false),
matchTerrainToTown(true),
townType(0),
terrainType (ETerrainType::GRASS),
zoneMonsterStrength(EMonsterStrength::ZONE_NORMAL),
totalDensity(0)
{
townTypes = getDefaultTownTypes();
terrainTypes = getDefaultTerrainTypes();
@ -370,7 +379,7 @@ void CRmgTemplateZone::fractalize(CMapGenerator* gen)
{
if (gen->isFree(tile))
clearedTiles.push_back(tile);
else if (gen->isPossible(tile));
else if (gen->isPossible(tile))
possibleTiles.insert(tile);
}
if (clearedTiles.empty()) //this should come from zone connections
@ -1032,8 +1041,8 @@ bool CRmgTemplateZone::findPlaceForObject(CMapGenerator* gen, CGObjectInstance*
//si32 min_dist = sqrt(tileinfo.size()/density);
int best_distance = 0;
bool result = false;
si32 w = gen->map->width;
si32 h = gen->map->height;
//si32 w = gen->map->width;
//si32 h = gen->map->height;
//logGlobal->infoStream() << boost::format("Min dist for density %f is %d") % density % min_dist;
@ -1265,6 +1274,7 @@ ObjectInfo CRmgTemplateZone::getRandomObject (CMapGenerator* gen, ui32 value)
if (r <= t.first)
return t.second;
}
//FIXME: control reaches end of non-void function. Missing return?
}
void CRmgTemplateZone::addAllPossibleObjects (CMapGenerator* gen)