Added support for optional submods of required mods.

This commit is contained in:
Daniel Scalzi
2018-07-29 16:32:41 +02:00
parent 60ba7b4f8a
commit 0c98cc2447
3 changed files with 50 additions and 18 deletions

View File

@@ -96,7 +96,7 @@ class ProcessBuilder {
* @returns {boolean} True if the mod is enabled, false otherwise.
*/
static isModEnabled(modCfg, required = null){
return modCfg != null ? ((typeof modCfg === 'boolean' && modCfg) || (typeof modCfg === 'object' && modCfg.value)) : required != null ? required.isDefault() : true
return modCfg != null ? ((typeof modCfg === 'boolean' && modCfg) || (typeof modCfg === 'object' && (typeof modCfg.value !== 'undefined' ? modCfg.value : true))) : required != null ? required.isDefault() : true
}
/**