# HG changeset patch # User Evan Giesel # Date 1641455917 21600 # Thu Jan 06 01:58:37 2022 -0600 # Node ID dec1140a0afc863da0c43bcf605f717fcb2420ec # Parent 3b1b63b76018d279a2b0ec9c1cd9e62be4c7abb9 update for v9 diff --git a/modules/bear_actor.js b/modules/bear_actor.js --- a/modules/bear_actor.js +++ b/modules/bear_actor.js @@ -48,6 +48,7 @@ async _preUpdate(changed, options, user) { await super._preUpdate(changed, options, user); + // set token vision if (changed.data && changed.data.darkvision === true){ this.data.token.update({ dimSight: 60, @@ -57,24 +58,30 @@ dimSight: 0, }); } - + // set token light emission if (changed.data && changed.data.torch === true){ this.data.token.update({ - dimLight: 40, - brightLight: 20 + light: { + dim: 40, + bright: 20 + } }); } else if (changed.data && changed.data.torch === false) { this.data.token.update({ - dimLight: 0, - brightLight: 0 + light: { + dim: 0, + bright: 0 + } }); } + // save these settings to all active linked tokens const docs_to_update = this.getActiveTokens(true).map(token => { // console.log(token); token.data.dimSight = this.data.token.dimSight; token.data.dimLight = this.data.token.dimLight; - token.data.brightLight = this.data.token.brightLight; + token.data.light.bright = this.data.token.light.bright; + token.data.light.dim = this.data.token.light.dim; return token.data; }); diff --git a/modules/bear_sheet.js b/modules/bear_sheet.js --- a/modules/bear_sheet.js +++ b/modules/bear_sheet.js @@ -11,7 +11,6 @@ getData() { const data = super.getData(); data.isGM = game.user.isGM; - // console.log(data); return data; } } \ No newline at end of file