mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-17 23:49:02 +01:00
Fixed so missing statuses doesn't cause crashes
This commit is contained in:
parent
72edef0a04
commit
3721f9ee3f
2 changed files with 9 additions and 7 deletions
|
|
@ -20,12 +20,14 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
|
||||||
for (var status of effect.statuses) {
|
for (var status of effect.statuses) {
|
||||||
if (!currentStatusActiveEffects.find(x => x.statuses.has(status))) {
|
if (!currentStatusActiveEffects.find(x => x.statuses.has(status))) {
|
||||||
const statusData = statusMap.get(status);
|
const statusData = statusMap.get(status);
|
||||||
acc.push({
|
if (statusData) {
|
||||||
name: game.i18n.localize(statusData.name),
|
acc.push({
|
||||||
statuses: [status],
|
name: game.i18n.localize(statusData.name),
|
||||||
img: statusData.icon,
|
statuses: [status],
|
||||||
tint: effect.tint
|
img: statusData.icon,
|
||||||
});
|
tint: effect.tint
|
||||||
|
});
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -118,7 +118,7 @@ export default class DhActiveEffect extends foundry.documents.ActiveEffect {
|
||||||
|
|
||||||
for (const statusId of this.statuses) {
|
for (const statusId of this.statuses) {
|
||||||
const status = CONFIG.statusEffects.find(s => s.id === statusId);
|
const status = CONFIG.statusEffects.find(s => s.id === statusId);
|
||||||
tags.push(game.i18n.localize(status.name));
|
if (status) tags.push(game.i18n.localize(status.name));
|
||||||
}
|
}
|
||||||
|
|
||||||
return tags;
|
return tags;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue