diff --git a/common/traits/receptacle.trait.js b/common/traits/receptacle.trait.js index ddf9eef..d7f0ca0 100644 --- a/common/traits/receptacle.trait.js +++ b/common/traits/receptacle.trait.js @@ -123,6 +123,7 @@ export class Receptacle extends decorate(Trait) { this.entity.removeItemFromSlot(slotIndex); item.destroy(); } + this.setDirty(); } }; this.qtyListeners.set(item, listener); @@ -206,11 +207,10 @@ export class Receptacle extends decorate(Trait) { if (AVOCADO_SERVER) { listeners.collisionStart = (other) => { if (other.is('item')) { - this.entity.addItemToSlot(other); - const slotIndex = this.itemSlotIndex(other); if (other.is('listed')) { other.list.removeEntity(other); } + this.entity.addItemToSlot(other); } }; } @@ -235,6 +235,7 @@ export class Receptacle extends decorate(Trait) { // CHEATING: assuming this entity is the informed json: item.toNetwork(this.entity), })); + this.setDirty(); } } this.entity.emit('inventoryChanged'); @@ -253,6 +254,7 @@ export class Receptacle extends decorate(Trait) { firstSlotIndex: slotIndex, secondSlotIndex: NULL_SLOT, })); + this.setDirty(); } this.entity.emit('inventoryChanged'); return item;