Add get game location util

This commit is contained in:
Vortrex
2021-03-15 12:32:46 -05:00
parent 1ae976d093
commit 994b5d04ed

View File

@@ -1554,6 +1554,23 @@ function getBusinessFromParams(params) {
// ---------------------------------------------------------------------------
function getGameLocationFromParams(params) {
if(isNaN(params)) {
for(let i in getGameData().locations) {
if(toLowerCase(getGameData().locations[i][0]).indexOf(toLowerCase(params)) != -1) {
return i;
}
}
} else {
if(typeof getGameData().locations[params] != "undefined") {
return toInteger(params);
}
}
return false;
}
// ---------------------------------------------------------------------------
function getHouseFromParams(params) {
if(isNaN(params)) {
for(let i in getServerData().houses) {
@@ -1919,4 +1936,12 @@ function generateRandomString(length) {
result += characters.charAt(Math.floor(Math.random() * charactersLength));
}
return result;
}
}
// ---------------------------------------------------------------------------
function getTimeDisplayUntilPlayerPayDay(client) {
return getTimeDifferenceDisplay(sdl.ticks-getPlayerData(client).payDayTickStart);
}
// ---------------------------------------------------------------------------