1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-11-25 22:42:04 +02:00

Fix miscellaneous issues discovered by Sonar

This commit is contained in:
Ivan Savenko
2024-08-12 18:26:30 +00:00
parent 39d3217d20
commit 97f1a310df
44 changed files with 95 additions and 117 deletions

View File

@@ -52,8 +52,8 @@ HighScoreCalculation::Result HighScoreCalculation::calculate()
{
Result firstResult;
Result summary;
const std::array<double, 5> difficultyMultipliers{0.8, 1.0, 1.3, 1.6, 2.0};
for(auto & param : parameters)
const std::array<double, 5> difficultyMultipliers{0.8, 1.0, 1.3, 1.6, 2.0};
for(const auto & param : parameters)
{
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};