2
0
Laserlicht 1 жил өмнө
parent
commit
939dd62491

+ 2 - 2
client/CServerHandler.cpp

@@ -681,12 +681,12 @@ HighScoreParameter CServerHandler::prepareHighScores(PlayerColor player, bool vi
 	for(const CGTownInstance * t : playerState->towns)
 		if(t->builtBuildings.count(BuildingID::GRAIL))
 			param.hasGrail = true;
-	param.allDefeated = true;
+	param.allEnemiesDefeated = true;
 	for (PlayerColor otherPlayer(0); otherPlayer < PlayerColor::PLAYER_LIMIT; ++otherPlayer)
 	{
 		auto ps = gs->getPlayerState(otherPlayer, false);
 		if(ps && otherPlayer != player && !ps->checkVanquished())
-			param.allDefeated = false;
+			param.allEnemiesDefeated = false;
 	}
 	param.scenarioName = gs->getMapHeader()->name.toString();
 	param.playerName = gs->getStartInfo()->playerInfos.find(player)->second.name;

+ 1 - 1
client/mainmenu/CHighScoreScreen.cpp

@@ -49,7 +49,7 @@ auto HighScoreCalculation::calculate()
 	const std::array<double, 5> difficultyMultipliers{0.8, 1.0, 1.3, 1.6, 2.0}; 
 	for(auto & param : parameters)
 	{
-		double tmp = 200 - (param.day + 10) / (param.townAmount + 5) + (param.allDefeated ? 25 : 0) + (param.hasGrail ? 25 : 0);
+		double tmp = 200 - (param.day + 10) / (param.townAmount + 5) + (param.allEnemiesDefeated ? 25 : 0) + (param.hasGrail ? 25 : 0);
 		firstResult = Result{static_cast<int>(tmp), static_cast<int>(tmp * difficultyMultipliers.at(param.difficulty)), param.day, param.usedCheat};
 		summary.basic += firstResult.basic * 5.0 / parameters.size();
 		summary.total += firstResult.total * 5.0 / parameters.size();

+ 2 - 2
lib/gameState/HighScore.h

@@ -19,7 +19,7 @@ public:
 	int townAmount;
 	bool usedCheat;
 	bool hasGrail;
-	bool allDefeated;
+	bool allEnemiesDefeated;
 	std::string campaignName;
 	std::string scenarioName;
 	std::string playerName;
@@ -31,7 +31,7 @@ public:
 		h & townAmount;
 		h & usedCheat;
 		h & hasGrail;
-		h & allDefeated;
+		h & allEnemiesDefeated;
 		h & campaignName;
 		h & scenarioName;
 		h & playerName;