Fix initiative

This commit is contained in:
2024-05-31 14:03:36 +02:00
parent 4fa9a911a0
commit 280e90d7a6
68 changed files with 159 additions and 223 deletions

View File

@@ -7,8 +7,8 @@ export class HawkmoonCombat extends Combat {
async rollInitiative(ids, formula = undefined, messageOptions = {} ) {
ids = typeof ids === "string" ? [ids] : ids;
for (let cId of ids) {
const c = this.combatants.get(ids[cId]);
//console.log("Init for combattant", c )
const c = this.combatants.get(cId);
console.log("Init for combattant", c, ids)
let id = c._id || c.id
let initValue = c.actor ? c.actor.getInitiativeScore() : 0
await this.updateEmbeddedDocuments("Combatant", [ { _id: id, initiative: initValue } ]);