Use feature supported check util

This commit is contained in:
Vortrex
2022-07-30 08:19:15 -05:00
parent 49aa8c35fe
commit 348fb2e469

View File

@@ -1696,60 +1696,65 @@ function areServerElementsSupported() {
// =========================================================================== // ===========================================================================
function isTimeSupported() { function isTimeSupported() {
return supportedFeatures.time[getGame()]; return isGameFeatureSupported("time");
} }
// =========================================================================== // ===========================================================================
function isWeatherSupported() { function isWeatherSupported() {
return supportedFeatures.weather[getGame()]; return isGameFeatureSupported("weather");
} }
// =========================================================================== // ===========================================================================
function arePickupsSupported() { function arePickupsSupported() {
return supportedFeatures.pickups[getGame()]; return isGameFeatureSupported("pickups");
} }
// =========================================================================== // ===========================================================================
function areBlipsSupported() { function areBlipsSupported() {
return supportedFeatures.blips[getGame()]; return isGameFeatureSupported("blips");
} }
// =========================================================================== // ===========================================================================
function areMarkersSupported() { function areMarkersSupported() {
return supportedFeatures.markers[getGame()]; return isGameFeatureSupported("markers");
} }
// =========================================================================== // ===========================================================================
function isFadeCameraSupported() { function isFadeCameraSupported() {
return supportedFeatures.fadeCamera[getGame()]; return isGameFeatureSupported("fadeCamera");
} }
// =========================================================================== // ===========================================================================
function isCustomCameraSupported() { function isCustomCameraSupported() {
return supportedFeatures.customCamera[getGame()]; return isGameFeatureSupported("customCamera");
} }
// =========================================================================== // ===========================================================================
function areFightStylesSupported() { function areFightStylesSupported() {
return supportedFeatures.fightStyles[getGame()]; return isGameFeatureSupported("fightStyles");
} }
// =========================================================================== // ===========================================================================
function areWorldLabelsSupported() { function areWorldLabelsSupported() {
return supportedFeatures.worldLabels[getGame()]; return isGameFeatureSupported("worldLabels");
} }
// =========================================================================== // ===========================================================================
function isGameFeatureSupported(featureName) { function isGameFeatureSupported(featureName) {
if (typeof supportedFeatures[featureName] === "undefined") {
submitBugReport(null, `[AUTOMATED REPORT] Game feature support error. Unknown feature name: ${featureName}`);
return false;
}
return supportedFeatures[featureName][getGame()]; return supportedFeatures[featureName][getGame()];
} }