From 9f0cb3d949865950641dd789e10beeaa86f52e06 Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Mon, 25 Oct 2021 13:08:33 -0500 Subject: [PATCH] Add get accent util, fix return on others --- scripts/server/utilities.js | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/scripts/server/utilities.js b/scripts/server/utilities.js index f1f77d0d..1bca3524 100644 --- a/scripts/server/utilities.js +++ b/scripts/server/utilities.js @@ -697,6 +697,24 @@ function updateServerRules() { // =========================================================================== +function getAccentFromParams(params) { + if(isNaN(params)) { + for(let i in getGlobalConfig().accents) { + if(toLowerCase(getGlobalConfig().accents[i]).indexOf(toLowerCase(params)) != -1) { + return i; + } + } + } else { + if(typeof getGlobalConfig().accents[params] != "undefined") { + return toInteger(params); + } + } + + return false; +} + +// =========================================================================== + function getWeatherFromParams(params) { if(isNaN(params)) { for(let i in getGameData().weatherNames[getServerGame()]) { @@ -709,9 +727,9 @@ function getWeatherFromParams(params) { return toInteger(params); } } - return 0; -} + return false; +} // =========================================================================== @@ -727,7 +745,8 @@ function getFightStyleFromParams(params) { return toInteger(params); } } - return 0; + + return false; } // =========================================================================== @@ -744,7 +763,8 @@ function getAnimationFromParams(params) { return toInteger(params); } } - return 0; + + return false; } // ===========================================================================