Fix set status-effects seulement pour le GM

This commit is contained in:
Vincent Vandemeulebrouck 2021-01-19 22:51:09 +01:00
parent 0e5495c6c4
commit 4efd8cdd0b

View File

@ -30,9 +30,8 @@ export class StatusEffects {
restricted: true restricted: true
}); });
CONFIG.RDD.allEffects = rddStatusEffects.concat(CONFIG.statusEffects); CONFIG.RDD.allEffects = rddStatusEffects.concat(CONFIG.statusEffects);
StatusEffects._setUseStatusEffects(StatusEffects._getUseStatusEffects()); StatusEffects._setUseStatusEffects(StatusEffects._getUseStatusEffects());
console.log('statusEffects', CONFIG.statusEffects); console.log('statusEffects', CONFIG.statusEffects);
} }
@ -65,7 +64,9 @@ export class StatusEffects {
} }
static _setUseStatusEffects(useStatusEffects) { static _setUseStatusEffects(useStatusEffects) {
game.settings.set("foundryvtt-reve-de-dragon", "use-status-effects", StatusEffects._toSetting(useStatusEffects)); if (game.user.isGM) {
game.settings.set("foundryvtt-reve-de-dragon", "use-status-effects", StatusEffects._toSetting(useStatusEffects));
}
for (let effect of CONFIG.RDD.allEffects) { for (let effect of CONFIG.RDD.allEffects) {
effect.active = effect.rdd || useStatusEffects.has(effect.id); effect.active = effect.rdd || useStatusEffects.has(effect.id);