mirror of
https://github.com/Foundryborne/daggerheart.git
synced 2026-01-12 11:41:08 +01:00
Fixed token path for message
This commit is contained in:
parent
8b864ba388
commit
6c5f34f6c6
2 changed files with 4 additions and 28 deletions
|
|
@ -100,13 +100,15 @@ export default class DamageField extends fields.SchemaField {
|
||||||
|
|
||||||
if (config.hasHealing)
|
if (config.hasHealing)
|
||||||
damagePromises.push(
|
damagePromises.push(
|
||||||
actor.takeHealing(config.damage).then(updates => targetDamage.push({ token: actor.token, updates }))
|
actor
|
||||||
|
.takeHealing(config.damage)
|
||||||
|
.then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates }))
|
||||||
);
|
);
|
||||||
else
|
else
|
||||||
damagePromises.push(
|
damagePromises.push(
|
||||||
actor
|
actor
|
||||||
.takeDamage(config.damage, config.isDirect)
|
.takeDamage(config.damage, config.isDirect)
|
||||||
.then(updates => targetDamage.push({ token: actor.token, updates }))
|
.then(updates => targetDamage.push({ token: actor.token ?? actor.prototypeToken, updates }))
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -208,32 +208,6 @@ export default class DhpChatMessage extends foundry.documents.ChatMessage {
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
Promise.all(damagePromises).then(async _ => {
|
|
||||||
const summaryMessageSettings = game.settings.get(
|
|
||||||
CONFIG.DH.id,
|
|
||||||
CONFIG.DH.SETTINGS.gameSettings.Automation
|
|
||||||
).summaryMessages;
|
|
||||||
if (!summaryMessageSettings.damage) return;
|
|
||||||
|
|
||||||
const cls = getDocumentClass('ChatMessage');
|
|
||||||
const msg = {
|
|
||||||
type: 'systemMessage',
|
|
||||||
user: game.user.id,
|
|
||||||
speaker: cls.getSpeaker(),
|
|
||||||
title: game.i18n.localize(
|
|
||||||
`DAGGERHEART.UI.Chat.damageSummary.${this.system.hasHealing ? 'healingTitle' : 'title'}`
|
|
||||||
),
|
|
||||||
content: await foundry.applications.handlebars.renderTemplate(
|
|
||||||
'systems/daggerheart/templates/ui/chat/damageSummary.hbs',
|
|
||||||
{
|
|
||||||
targets: targetDamage
|
|
||||||
}
|
|
||||||
)
|
|
||||||
};
|
|
||||||
|
|
||||||
cls.create(msg);
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
async onRollAllSave(event) {
|
async onRollAllSave(event) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue