diff --git a/dDatabase/GameDatabase/MySQL/Tables/Leaderboard.cpp b/dDatabase/GameDatabase/MySQL/Tables/Leaderboard.cpp index 949de9c9..5c5c0521 100644 --- a/dDatabase/GameDatabase/MySQL/Tables/Leaderboard.cpp +++ b/dDatabase/GameDatabase/MySQL/Tables/Leaderboard.cpp @@ -41,7 +41,7 @@ std::vector MySQLDatabase::GetDefaultLeaderboard(const uint } std::vector MySQLDatabase::GetAgsLeaderboard(const uint32_t activityId) { - auto query = Game::config->GetValue("classic_survival_scoring") == "1" ? + auto query = Game::config->GetValue("classic_survival_scoring") != "1" ? "SELECT *, UNIX_TIMESTAMP(last_played) as lp_unix, ci.name as char_name FROM leaderboard lb JOIN charinfo ci on ci.id = lb.character_id where game_id = ? ORDER BY primaryscore DESC, secondaryscore DESC, tertiaryScore DESC, last_played ASC;" : "SELECT *, UNIX_TIMESTAMP(last_played) as lp_unix, ci.name as char_name FROM leaderboard lb JOIN charinfo ci on ci.id = lb.character_id where game_id = ? ORDER BY secondaryscore DESC, primaryscore DESC, tertiaryScore DESC, last_played ASC;"; auto leaderboard = ExecuteSelect(query, activityId); diff --git a/dGame/LeaderboardManager.cpp b/dGame/LeaderboardManager.cpp index 89634cee..e4b9db35 100644 --- a/dGame/LeaderboardManager.cpp +++ b/dGame/LeaderboardManager.cpp @@ -149,7 +149,7 @@ std::vector FilterTo10(const std::vector FilterTo10(const std::vector leaderboard.size() - 10) { toReturn.assign(leaderboard.end() - 10, leaderboard.end()); // get the bottom 10 since we are in the bottom 10 + index = leaderboard.size() - 10; } else { toReturn.assign(leaderboard.begin() + index - 5, leaderboard.begin() + index + 5); // get the 5 above and below + index -= 5; } int32_t i = index;