Browse Source

Merge pull request #3399 from Kuxe/ENABLE_STRICT_COMPILATION-compilation_fixes

ENABLE_STRICT_COMPILATION compilation fixes
Ivan Savenko 1 year ago
parent
commit
da9b3299c5

+ 3 - 4
AI/Nullkiller/Analyzers/DangerHitMapAnalyzer.cpp

@@ -265,8 +265,9 @@ uint64_t DangerHitMapAnalyzer::enemyCanKillOurHeroesAlongThePath(const AIPath &
 {
 	int3 tile = path.targetTile();
 	int turn = path.turn();
-	const HitMapNode & info = hitMap[tile.x][tile.y][tile.z];
 
+	const auto& info = getTileThreat(tile);
+	
 	return (info.fastestDanger.turn <= turn && !isSafeToVisit(path.targetHero, path.heroArmy, info.fastestDanger.danger))
 		|| (info.maximumDanger.turn <= turn && !isSafeToVisit(path.targetHero, path.heroArmy, info.maximumDanger.danger));
 }
@@ -280,9 +281,7 @@ const HitMapNode & DangerHitMapAnalyzer::getObjectThreat(const CGObjectInstance
 
 const HitMapNode & DangerHitMapAnalyzer::getTileThreat(const int3 & tile) const
 {
-	const HitMapNode & info = hitMap[tile.x][tile.y][tile.z];
-
-	return info;
+	return hitMap[tile.x][tile.y][tile.z];
 }
 
 const std::set<const CGObjectInstance *> empty = {};

+ 1 - 3
AI/VCAI/Pathfinding/AINodeStorage.cpp

@@ -321,9 +321,7 @@ bool AINodeStorage::hasBetterChain(const PathNodeInfo & source, CDestinationNode
 
 bool AINodeStorage::isTileAccessible(const int3 & pos, const EPathfindingLayer layer) const
 {
-	const AIPathNode & node = nodes[layer][pos.z][pos.x][pos.y][0];
-
-	return node.action != EPathNodeAction::UNKNOWN;
+	return nodes[layer][pos.z][pos.x][pos.y][0].action != EPathNodeAction::UNKNOWN;
 }
 
 std::vector<AIPath> AINodeStorage::getChainInfo(const int3 & pos, bool isOnLand) const

+ 1 - 1
lib/mapObjects/CGPandoraBox.cpp

@@ -226,7 +226,7 @@ void CGPandoraBox::serializeJsonOptions(JsonSerializeFormat & handler)
 		handler.serializeInt("experience", vinfo.reward.heroExperience, 0);
 		handler.serializeInt("mana", vinfo.reward.manaDiff, 0);
 		
-		int val;
+		int val = 0;
 		handler.serializeInt("morale", val, 0);
 		if(val)
 			vinfo.reward.bonuses.emplace_back(BonusDuration::ONE_BATTLE, BonusType::MORALE, BonusSource::OBJECT_INSTANCE, val, BonusSourceID(id));