Loosened checks on statuses to make module compatible (#1407)

This commit is contained in:
WBHarry 2025-12-09 22:43:36 +01:00 committed by GitHub
parent 2b1535333a
commit 8eae1c0763
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 4 additions and 2 deletions

View file

@ -197,6 +197,8 @@ export default class DHTokenHUD extends foundry.applications.hud.TokenHUD {
for (const effect of activeEffects) { for (const effect of activeEffects) {
for (const statusId of effect.statuses) { for (const statusId of effect.statuses) {
const status = choices[statusId]; const status = choices[statusId];
if (!status) continue;
status.instances = 1 + (status.instances ?? 0); status.instances = 1 + (status.instances ?? 0);
status.locked = status.locked || effect.condition || status.instances > 1; status.locked = status.locked || effect.condition || status.instances > 1;
if (!status) continue; if (!status) continue;

View file

@ -854,7 +854,7 @@ export default class DhpActor extends Actor {
acc.push(effect); acc.push(effect);
const currentStatusActiveEffects = acc.filter( const currentStatusActiveEffects = acc.filter(
x => x.statuses.size === 1 && x.name === game.i18n.localize(statusMap.get(x.statuses.first()).name) x => x.statuses.size === 1 && x.name === game.i18n.localize(statusMap.get(x.statuses.first())?.name)
); );
for (var status of effect.statuses) { for (var status of effect.statuses) {

View file

@ -2,7 +2,7 @@
"id": "daggerheart", "id": "daggerheart",
"title": "Daggerheart", "title": "Daggerheart",
"description": "An unofficial implementation of the Daggerheart system", "description": "An unofficial implementation of the Daggerheart system",
"version": "1.3.1", "version": "1.3.2",
"compatibility": { "compatibility": {
"minimum": "13.346", "minimum": "13.346",
"verified": "13.351", "verified": "13.351",