Add get accent util, fix return on others

This commit is contained in:
Vortrex
2021-10-25 13:08:33 -05:00
parent ffd9558f03
commit 9f0cb3d949

View File

@@ -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;
}
// ===========================================================================