Browse Source

Merge pull request #451 from josch/develop

Remove compilation warnings
ArseniyShestakov 7 years ago
parent
commit
6f6f399911

+ 0 - 1
AI/VCAI/VCAI.cpp

@@ -1369,7 +1369,6 @@ void VCAI::buildStructure(const CGTownInstance * t)
 	//below algorithm focuses on economy growth at start of the game.
 	TResources currentRes = cb->getResourceAmount();
 	TResources currentIncome = t->dailyIncome();
-	int townIncome = currentIncome[Res::GOLD];
 
 	if(tryBuildAnyStructure(t, std::vector<BuildingID>(essential, essential + ARRAY_COUNT(essential))))
 		return;

+ 1 - 2
client/CPlayerInterface.cpp

@@ -1042,7 +1042,6 @@ void CPlayerInterface::battleAttack(const BattleAttack * ba)
 	}
 	else
 	{
-		auto attackFrom = actionTarget.at(0).hexValue;
 		auto attackTarget = actionTarget.at(1).hexValue;
 
 		//TODO: use information from BattleAttack but not curAction
@@ -1336,7 +1335,7 @@ template <typename Handler> void CPlayerInterface::serializeTempl( Handler &h, c
 {
 	if(version < 774 && !h.saving)
 	{
-		bool observerInDuelMode;
+		bool observerInDuelMode = false;
 		h & observerInDuelMode;
 	}
 

+ 1 - 1
client/battle/CBattleInterface.cpp

@@ -2747,7 +2747,7 @@ void CBattleInterface::obstaclePlaced(const CObstacleInstance & oi)
 	//so when multiple obstacles are added, they show up one after another
 	waitForAnims();
 
-	soundBase::soundID sound; // FIXME(v.markovtsev): soundh->playSound() is commented in the end => warning
+	//soundBase::soundID sound; // FIXME(v.markovtsev): soundh->playSound() is commented in the end => warning
 
 	std::string defname;
 

+ 2 - 2
lib/CGeneralTextHandler.cpp

@@ -250,7 +250,7 @@ std::string CLegacyConfigParser::readRawString()
 	else
 		ret = extractNormalString();//string without quotes - copy till \t or \r
 
-		curr++;
+	curr++;
 	return ret;
 }
 
@@ -292,7 +292,7 @@ bool CLegacyConfigParser::endLine()
 	while (curr < end && *curr !=  '\n')
 		readString();
 
-		curr++;
+	curr++;
 
 	return curr < end;
 }

+ 1 - 2
lib/rmg/CRmgTemplateZone.cpp

@@ -597,10 +597,9 @@ bool CRmgTemplateZone::createRoad(const int3& src, const int3& dst)
 				if (distance < bestDistanceSoFar)
 				{
 					auto tile = &gen->map->getTile(pos);
-					auto obj = tile->topVisitableObj();
 					bool canMoveBetween = gen->map->canMoveBetween(currentNode, pos);
 
-					if (gen->isFree(pos) && gen->isFree(currentNode) //empty path
+					if ((gen->isFree(pos) && gen->isFree(currentNode)) //empty path
 						|| ((tile->visitable || currentTile->visitable) && canMoveBetween) //moving from or to visitable object
 						|| pos == dst) //we already compledted the path
 					{

+ 0 - 2
server/CVCMIServer.cpp

@@ -580,7 +580,6 @@ void CVCMIServer::setPlayer(PlayerColor clickedColor)
 
 
 	PlayerSettings & clicked = si->playerInfos[clickedColor];
-	PlayerSettings * old = nullptr;
 
 	//identify clicked player
 	int clickedNameID = 0; //number of player - zero means AI, assume it initially
@@ -628,7 +627,6 @@ void CVCMIServer::setPlayer(PlayerColor clickedColor)
 				playerToRestore.color = i->first;
 				playerToRestore.id = newPlayer;
 				setPlayerConnectedId(i->second, PlayerSettings::PLAYER_AI); //set computer
-				old = &i->second;
 				break;
 			}
 		}