Skip to content

Commit

Permalink
remove extra stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
EmosewaMC committed Dec 4, 2024
1 parent e56d4df commit 768a9ed
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions dGame/LeaderboardManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,6 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi

const auto oldScore = Database::Get()->GetPlayerScore(playerID, activityId);

std::string saveQuery("UPDATE leaderboard SET timesPlayed = timesPlayed + 1 WHERE character_id = ? AND game_id = ?;");
ILeaderboard::Score newScore{ .primaryScore = primaryScore, .secondaryScore = secondaryScore, .tertiaryScore = tertiaryScore };
if (oldScore.has_value()) {
bool lowerScoreBetter = leaderboardType == Leaderboard::Type::Racing || leaderboardType == Leaderboard::Type::MonumentRace;
Expand All @@ -286,13 +285,13 @@ void LeaderboardManager::SaveScore(const LWOOBJID& playerID, const GameID activi
ILeaderboard::Score newScoreFlipped(newScore.secondaryScore, newScore.primaryScore);

Check failure on line 285 in dGame/LeaderboardManager.cpp

View workflow job for this annotation

GitHub Actions / Build & Test (macos-13)

no matching constructor for initialization of 'ILeaderboard::Score'
newHighScore = newScoreFlipped > oldScoreFlipped;
}

if (newHighScore) {
Database::Get()->UpdateScore(playerID, activityId, newScore);
}
} else {
Database::Get()->SaveScore(playerID, activityId, newScore);
}
LOG("save query %s %i %i", saveQuery.c_str(), playerID, activityId);

// track wins separately
if (leaderboardType == Leaderboard::Type::Racing && tertiaryScore != 0.0f) {
Expand Down

0 comments on commit 768a9ed

Please sign in to comment.