Merged with main

This commit is contained in:
WBHarry 2026-03-26 16:17:23 +01:00
commit 4319fbabb9
11 changed files with 88 additions and 12 deletions

View file

@ -30,6 +30,18 @@ export default class DhpActor extends Actor {
return this.system.metadata.isNPC;
}
prepareData() {
super.prepareData();
// Update effects if it is the user's character or is controlled
if (canvas.ready) {
const controlled = canvas.tokens.controlled.some(t => t.actor === this);
if (game.user.character === this || controlled) {
ui.effectsDisplay.render();
}
}
}
/* -------------------------------------------- */
/** @inheritDoc */
@ -122,14 +134,6 @@ export default class DhpActor extends Actor {
}
}
_onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId) {
if (collection === 'effects') {
ui.effectsDisplay.render();
}
super._onUpdateDescendantDocuments(parent, collection, documents, changes, options, userId);
}
async updateLevel(newLevel) {
if (!['character', 'companion'].includes(this.type) || newLevel === this.system.levelData.level.changed) return;