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() {
return supportedFeatures.time[getGame()];
return isGameFeatureSupported("time");
}
// ===========================================================================
function isWeatherSupported() {
return supportedFeatures.weather[getGame()];
return isGameFeatureSupported("weather");
}
// ===========================================================================
function arePickupsSupported() {
return supportedFeatures.pickups[getGame()];
return isGameFeatureSupported("pickups");
}
// ===========================================================================
function areBlipsSupported() {
return supportedFeatures.blips[getGame()];
return isGameFeatureSupported("blips");
}
// ===========================================================================
function areMarkersSupported() {
return supportedFeatures.markers[getGame()];
return isGameFeatureSupported("markers");
}
// ===========================================================================
function isFadeCameraSupported() {
return supportedFeatures.fadeCamera[getGame()];
return isGameFeatureSupported("fadeCamera");
}
// ===========================================================================
function isCustomCameraSupported() {
return supportedFeatures.customCamera[getGame()];
return isGameFeatureSupported("customCamera");
}
// ===========================================================================
function areFightStylesSupported() {
return supportedFeatures.fightStyles[getGame()];
return isGameFeatureSupported("fightStyles");
}
// ===========================================================================
function areWorldLabelsSupported() {
return supportedFeatures.worldLabels[getGame()];
return isGameFeatureSupported("worldLabels");
}
// ===========================================================================
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()];
}