Browse Source

remove setting values that are never read

Andrey Filipenkov 3 years ago
parent
commit
659be89a01

+ 0 - 4
AI/Nullkiller/Analyzers/BuildAnalyzer.cpp

@@ -205,8 +205,6 @@ BuildingInfo BuildAnalyzer::getBuildingOrPrerequisite(
 	logAi->trace("checking %s", info.name);
 	logAi->trace("buildInfo %s", info.toString());
 
-	buildPtr = nullptr;
-
 	if(!town->hasBuilt(building))
 	{
 		auto canBuild = ai->cb->canBuildStructure(town, building);
@@ -239,8 +237,6 @@ BuildingInfo BuildAnalyzer::getBuildingOrPrerequisite(
 			}
 			else
 			{
-				buildPtr = townInfo->buildings.at(building);
-
 				logAi->trace("cant build. Need %d", missingBuildings[0].num);
 
 				BuildingInfo prerequisite = getBuildingOrPrerequisite(town, missingBuildings[0], excludeDwellingDependencies);

+ 0 - 1
AI/Nullkiller/Pathfinding/Rules/AIMovementAfterDestinationRule.cpp

@@ -147,7 +147,6 @@ namespace AIPathfinding
 					return false;
 				}
 
-				destinationNode = questNode.get();
 				destination.node = questNode.get();
 
 				nodeStorage->commit(destination, source);

+ 1 - 1
lib/CCreatureHandler.cpp

@@ -1230,7 +1230,7 @@ void CCreatureHandler::loadStackExp(Bonus & b, BonusList & bl, CLegacyConfigPars
 	{
 		if (b.type != Bonus::REBIRTH)
 			b.val = 0; //on-off ability, no value specified
-		curVal = static_cast<si32>(parser.readNumber());// 0 level is never active
+		parser.readNumber(); // 0 level is never active
 		for (int i = 1; i < 11; ++i)
 		{
 			curVal = static_cast<si32>(parser.readNumber());

+ 1 - 0
lib/CStack.cpp

@@ -304,6 +304,7 @@ std::vector<BattleHex> CStack::meleeAttackHexes(const battle::Unit * attacker, c
 			res.push_back(otherDefenderPos);
 		}
 	}
+	UNUSED(mask);
 
 	return res;
 }