diff --git a/module/actor.js b/module/actor.js index 0f497714..9df2bd1c 100644 --- a/module/actor.js +++ b/module/actor.js @@ -311,6 +311,9 @@ export class RdDActor extends Actor { } return duplicate(list[0]); } + getDemiReve() { + return this.data.data.reve.tmrpos.coord; + } /* -------------------------------------------- */ async deleteSortReserve(sortReserve) { let reserve = duplicate(this.data.data.reve.reserve); @@ -1193,7 +1196,7 @@ export class RdDActor extends Actor { //console.log("List", rencontres, len); let newTable = []; for (i = 0; i < len; i++) { - if (rencontres.list[i].coord != this.data.data.reve.tmrpos.coord) + if (rencontres.list[i].coord != this.getDemiReve()) newTable.push(rencontres.list[i]); } if (newTable.length != len) { @@ -1210,7 +1213,7 @@ export class RdDActor extends Actor { let i = 0; let already = false; for (i = 0; i < len; i++) { - if (rencontres.list[i].coord == this.data.data.reve.tmrpos.coord) + if (rencontres.list[i].coord == this.getDemiReve()) already = true; } if (!already) { @@ -1232,9 +1235,7 @@ export class RdDActor extends Actor { /* -------------------------------------------- */ async updateCoordTMR(coord) { - let tmrPos = duplicate(this.data.data.reve.tmrpos); - tmrPos.coord = coord; - await this.update({ "data.reve.tmrpos": tmrPos }); + await this.update({ "data.reve.tmrpos.coord": coord }); } /* -------------------------------------------- */