Fix suppression pelerinage/fermeture-cites

et suppression du pèlerinage lorsqu'on est arrivé
This commit is contained in:
Vincent Vandemeulebrouck
2021-02-12 18:31:49 +01:00
parent 4f35b28aa1
commit 6708e3eb71
3 changed files with 21 additions and 22 deletions

View File

@ -14,7 +14,7 @@ export class Pelerinage extends Draconique {
async onActorCreateOwned(actor, queue) {
let tmr = TMRUtility.getTMRAleatoire();
await this.createCaseTmr(actor, 'Pèlerinage: ' + tmr.label, tmr);
await this.createCaseTmr(actor, 'Pèlerinage: ' + tmr.label, tmr, queue._id);
}
@ -34,8 +34,7 @@ export class Pelerinage extends Draconique {
async onFinPelerinage(actor, tmr, onRemoveToken) {
const pelerinages = actor.data.items.filter(it => this.isCase(it, tmr.coord));
for (let p of pelerinages){
await actor.deleteOwnedItem(p._id);
await actor.deleteOwnedItem(p.data.sourceId);
await actor.deleteOwnedItem(p.data.sourceid);
onRemoveToken(tmr, p);
}
}