From a4500fdbce16dfd43b13685350450fc8faaee78e Mon Sep 17 00:00:00 2001 From: Vortrex <3858226+VortrexFTW@users.noreply.github.com> Date: Fri, 18 Feb 2022 15:37:35 -0600 Subject: [PATCH] Fix game location util --- scripts/shared/utilities.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/shared/utilities.js b/scripts/shared/utilities.js index c61cd59a..808ccb91 100644 --- a/scripts/shared/utilities.js +++ b/scripts/shared/utilities.js @@ -1117,13 +1117,14 @@ async function waitUntil(condition) { function getGameLocationFromParams(params) { if(isNaN(params)) { - for(let i in getGameData().locations[getServerGame()]) { - if(toLowerCase(getGameData().locations[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) { + let locations = getGameData().locations[getGame()]; + for(let i in locations) { + if(toLowerCase(locations[i][0]).indexOf(toLowerCase(params)) != -1) { return i; } } } else { - if(typeof getGameData().locations[getServerGame()][params] != "undefined") { + if(typeof getGameData().locations[getGame()][params] != "undefined") { return toInteger(params); } }