From 0aa59a4bfcc8257c445ab1ceca966f1a4092900a Mon Sep 17 00:00:00 2001 From: Stefan Zermatten Date: Mon, 1 Mar 2021 14:15:21 +0200 Subject: [PATCH] Fixed creature not recomputing correctly when weight carried changes --- app/imports/api/creature/denormalise/recomputeInventory.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/app/imports/api/creature/denormalise/recomputeInventory.js b/app/imports/api/creature/denormalise/recomputeInventory.js index e030f1cf..dd7f7237 100644 --- a/app/imports/api/creature/denormalise/recomputeInventory.js +++ b/app/imports/api/creature/denormalise/recomputeInventory.js @@ -84,13 +84,13 @@ function getInventoryData(tree, containersToWrite){ for (let key in data){ data[key] += childData[key]; } + if (node.contentsWeightless){ + data.weightCarried = node.weight; + } if (node.carried === false){ data.weightCarried = 0; data.valueCarried = 0; } - if (node.contentsWeightless){ - data.weightCarried = node.weight; - } return data }