Fix calcul encTotal

Autant le calculer depuis les objets eux-mêmes
This commit is contained in:
Vincent Vandemeulebrouck
2021-05-27 22:40:12 +02:00
parent 46642d31a9
commit 95bcc2e77c
3 changed files with 43 additions and 29 deletions

View File

@ -1142,9 +1142,7 @@ export class RdDActor extends Actor {
/* -------------------------------------------- */
computeEncombrement() {
this.encTotal = this.filterItemsData(it => it.data.encombrement != undefined)
.map(it => it.data.encTotal)
.reduce(Misc.sum(), 0);
this.encTotal = this.items.map(it => it.getEncTotal()).reduce(Misc.sum(), 0);
return this.encTotal;
}