Working on 0.8.x

- entities -> contents
- RnK button black if no action left
This commit is contained in:
Vlyan
2021-05-03 19:34:30 +02:00
parent 93cfe5bb86
commit c2d2dbb9fe
12 changed files with 37 additions and 35 deletions

View File

@@ -42,7 +42,7 @@ export class CombatL5r5e extends Combat {
// Get score for each combatant
const updatedCombatants = [];
for (const combatantId of ids) {
const combatant = game.combat.combatants.find((c) => c._id === combatantId);
const combatant = game.combat.combatants.find((c) => c.id === combatantId);
// Skip if combatant already have a initiative value
if (!messageOptions.rerollInitiative && (!combatant || !combatant.actor)) {
@@ -124,13 +124,13 @@ export class CombatL5r5e extends Combat {
}
updatedCombatants.push({
_id: combatant._id,
_id: combatant.id,
initiative: initiative,
});
}
// Update all combatants at once
await this.updateEmbeddedEntity("Combatant", updatedCombatants);
await this.updateEmbeddedDocuments("Combatant", updatedCombatants);
return this;
}