Rename game config util
This commit is contained in:
@@ -52,7 +52,7 @@ function getAreaName(position) {
|
||||
// ===========================================================================
|
||||
|
||||
function getGameAreas(gameId) {
|
||||
return getGameData().areas[gameId];
|
||||
return getGameConfig().areas[gameId];
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -92,7 +92,7 @@ function updateServerRules() {
|
||||
|
||||
if(isWeatherSupported()) {
|
||||
if(getServerConfig() != false) {
|
||||
let value = getGameData().weatherNames[getServerGame()][getServerConfig().weather];
|
||||
let value = getGameConfig().weatherNames[getServerGame()][getServerConfig().weather];
|
||||
logToConsole(LOG_DEBUG, `[VRR.Utilities]: Setting server rule "Weather" as ${value}`);
|
||||
server.setRule("Weather", value);
|
||||
}
|
||||
@@ -112,13 +112,13 @@ function updateServerRules() {
|
||||
|
||||
function getWeatherFromParams(params) {
|
||||
if(isNaN(params)) {
|
||||
for(let i in getGameData().weatherNames[getServerGame()]) {
|
||||
if(toLowerCase(getGameData().weatherNames[getServerGame()][i]).indexOf(toLowerCase(params)) != -1) {
|
||||
for(let i in getGameConfig().weatherNames[getServerGame()]) {
|
||||
if(toLowerCase(getGameConfig().weatherNames[getServerGame()][i]).indexOf(toLowerCase(params)) != -1) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(typeof getGameData().weatherNames[getServerGame()][params] != "undefined") {
|
||||
if(typeof getGameConfig().weatherNames[getServerGame()][params] != "undefined") {
|
||||
return toInteger(params);
|
||||
}
|
||||
}
|
||||
@@ -130,13 +130,13 @@ function getWeatherFromParams(params) {
|
||||
|
||||
function getFightStyleFromParams(params) {
|
||||
if(isNaN(params)) {
|
||||
for(let i in getGameData().fightStyles[getServerGame()]) {
|
||||
if(toLowerCase(getGameData().fightStyles[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
|
||||
for(let i in getGameConfig().fightStyles[getServerGame()]) {
|
||||
if(toLowerCase(getGameConfig().fightStyles[getServerGame()][i][0]).indexOf(toLowerCase(params)) != -1) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if(typeof getGameData().fightStyles[getServerGame()][params] != "undefined") {
|
||||
if(typeof getGameConfig().fightStyles[getServerGame()][params] != "undefined") {
|
||||
return toInteger(params);
|
||||
}
|
||||
}
|
||||
@@ -148,26 +148,26 @@ function getFightStyleFromParams(params) {
|
||||
|
||||
function getClosestHospital(position) {
|
||||
let closest = 0;
|
||||
for(let i in getGameData().hospitals[getServerGame()]) {
|
||||
if(getDistance(getGameData().hospitals[getServerGame()][i].position, position) < getDistance(getGameData().hospitals[getServerGame()][closest].position, position)) {
|
||||
for(let i in getGameConfig().hospitals[getServerGame()]) {
|
||||
if(getDistance(getGameConfig().hospitals[getServerGame()][i].position, position) < getDistance(getGameConfig().hospitals[getServerGame()][closest].position, position)) {
|
||||
closest = i;
|
||||
}
|
||||
}
|
||||
|
||||
return getGameData().hospitals[getServerGame()][closest];
|
||||
return getGameConfig().hospitals[getServerGame()][closest];
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
|
||||
function getClosestPoliceStation(position) {
|
||||
let closest = 0;
|
||||
for(let i in getGameData().policeStations[getServerGame()]) {
|
||||
if(getDistance(getGameData().policeStations[getServerGame()][i].position, position) < getDistance(getGameData().policeStations[getServerGame()][closest].position, position)) {
|
||||
for(let i in getGameConfig().policeStations[getServerGame()]) {
|
||||
if(getDistance(getGameConfig().policeStations[getServerGame()][i].position, position) < getDistance(getGameConfig().policeStations[getServerGame()][closest].position, position)) {
|
||||
closest = i;
|
||||
}
|
||||
}
|
||||
|
||||
return getGameData().policeStations[getServerGame()][closest];
|
||||
return getGameConfig().policeStations[getServerGame()][closest];
|
||||
}
|
||||
|
||||
// ===========================================================================
|
||||
@@ -206,8 +206,8 @@ function getPlayerIsland(client) {
|
||||
// ===========================================================================
|
||||
|
||||
function isAtPayAndSpray(position) {
|
||||
for(let i in getGameData().payAndSprays[getServerGame()]) {
|
||||
if(getDistance(position, getGameData().payAndSprays[getServerGame()][i]) <= getGlobalConfig().payAndSprayDistance) {
|
||||
for(let i in getGameConfig().payAndSprays[getServerGame()]) {
|
||||
if(getDistance(position, getGameConfig().payAndSprays[getServerGame()][i]) <= getGlobalConfig().payAndSprayDistance) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user