Explorar el Código

Fixed warnings

Ivan Savenko hace 10 años
padre
commit
eef45b5ae8

+ 1 - 1
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))

+ 1 - 1
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;
 
 

+ 1 - 1
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;
 

+ 1 - 1
lib/rmg/CMapGenerator.h

@@ -96,7 +96,7 @@ private:
 	CTileInfo*** tiles;
 
 	int prisonsRemaining;
-	int questArtsRemaining;
+	//int questArtsRemaining;
 	int monolithIndex;
 	std::vector<ArtifactID> questArtifacts;
 

+ 2 - 2
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<ui16>::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);