From cf7635f57b719d3c2bb78a4321b0fc36bb08bd1a Mon Sep 17 00:00:00 2001 From: elexis Date: Sat, 4 Jan 2020 17:10:12 +0000 Subject: [PATCH] Remove JSInterface_Lobby IsRankedGame function duplicitous with g_GameAttributes.settings.RatingEnabled && !g_IsReplay, refs #3550, D2483. This was SVN commit r23329. --- .../mods/public/gui/session/lobby/LobbyRatingReporter.js | 6 +++++- source/lobby/scripting/JSInterface_Lobby.cpp | 6 ------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/binaries/data/mods/public/gui/session/lobby/LobbyRatingReporter.js b/binaries/data/mods/public/gui/session/lobby/LobbyRatingReporter.js index f5e729f4ae..b7040535bf 100644 --- a/binaries/data/mods/public/gui/session/lobby/LobbyRatingReporter.js +++ b/binaries/data/mods/public/gui/session/lobby/LobbyRatingReporter.js @@ -49,5 +49,9 @@ class LobbyRatingReporter */ LobbyRatingReporter.Available = function() { - return Engine.HasXmppClient() && Engine.IsRankedGame() && g_GameAttributes.settings.PlayerData.length == 3; + return Engine.HasXmppClient() && + !g_IsReplay && + Engine.GetPlayerID() != -1 && + g_GameAttributes.settings.RatingEnabled && + g_GameAttributes.settings.PlayerData.length == 3; }; diff --git a/source/lobby/scripting/JSInterface_Lobby.cpp b/source/lobby/scripting/JSInterface_Lobby.cpp index ef3c2e5151..498c6fcdd6 100644 --- a/source/lobby/scripting/JSInterface_Lobby.cpp +++ b/source/lobby/scripting/JSInterface_Lobby.cpp @@ -37,7 +37,6 @@ void JSI_Lobby::RegisterScriptFunctions(const ScriptInterface& scriptInterface) { // Lobby functions scriptInterface.RegisterFunction("HasXmppClient"); - scriptInterface.RegisterFunction("IsRankedGame"); scriptInterface.RegisterFunction("SetRankedGame"); #if CONFIG2_LOBBY // Allow the lobby to be disabled scriptInterface.RegisterFunction("StartXmppClient"); @@ -78,11 +77,6 @@ bool JSI_Lobby::HasXmppClient(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) return g_XmppClient; } -bool JSI_Lobby::IsRankedGame(ScriptInterface::CxPrivate* UNUSED(pCxPrivate)) -{ - return g_rankedGame; -} - void JSI_Lobby::SetRankedGame(ScriptInterface::CxPrivate* UNUSED(pCxPrivate), bool isRanked) { g_rankedGame = isRanked;