async endCombat() {
await super.endCombat();
this._recoverUses({ turn: true, turnEnd: true, turnStart: true });
return this;
}
The _recoverUses is always triggered.
It might be down to Foundry to reimplement the endCombat in a more extensible friendly way (but the system should find a way to patch this bug essentially faster via deleteCombat probably).
This is from Foundry's code base
async endCombat() {
await foundry.applications.api.DialogV2.confirm({
window: {title: "COMBAT.EndTitle"},
content: `<p>${game.i18n.localize("COMBAT.EndConfirmation")}</p>`,
yes: {callback: () => this.delete()},
modal: true
});
return this;
}
The way the deletion is hidden inside the dialog.yes means that the subclass caliing super.endCombat() can't distinguish confirm vs cancel from the return value alone.
The
_recoverUsesis always triggered.It might be down to Foundry to reimplement the
endCombatin a more extensible friendly way (but the system should find a way to patch this bug essentially faster viadeleteCombatprobably).This is from Foundry's code base
The way the deletion is hidden inside the
dialog.yesmeans that the subclass caliingsuper.endCombat()can't distinguish confirm vs cancel from the return value alone.