diff --git a/app/ecs-components/inventory.js b/app/ecs-components/inventory.js index 380e9aa..bf9dd1c 100644 --- a/app/ecs-components/inventory.js +++ b/app/ecs-components/inventory.js @@ -2,7 +2,6 @@ import Schema from '@/ecs/schema.js'; export default function(Component) { return class Inventory extends Component { - insertMany(entities) { for (const [id, {slotChange}] of entities) { if (slotChange) { @@ -22,7 +21,6 @@ export default function(Component) { } return super.insertMany(entities); } - mergeDiff(original, update) { if (!update.slotChange) { return super.mergeDiff(original, update); @@ -57,6 +55,7 @@ export default function(Component) { target[property] = value; if ('qty' === property && value <= 0) { Component.markChange(instance.entity, 'slotChange', {[slot]: false}); + delete slots[slot]; } else { Component.markChange(instance.entity, 'slotChange', {[slot]: {[property]: value}});