From bbd38bd6183c6dc345716c59d7939854be8aba27 Mon Sep 17 00:00:00 2001 From: Vincent Vandemeulebrouck Date: Sun, 28 Feb 2021 01:50:46 +0100 Subject: [PATCH] =?UTF-8?q?Extrait=20m=C3=A9thode=20Actor.getDemiReve?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- module/actor.js | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) 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 }); } /* -------------------------------------------- */