fix: set dirty to avoid dupes
This commit is contained in:
parent
f106371fca
commit
86f1fb0b11
|
@ -123,6 +123,7 @@ export class Receptacle extends decorate(Trait) {
|
||||||
this.entity.removeItemFromSlot(slotIndex);
|
this.entity.removeItemFromSlot(slotIndex);
|
||||||
item.destroy();
|
item.destroy();
|
||||||
}
|
}
|
||||||
|
this.setDirty();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
this.qtyListeners.set(item, listener);
|
this.qtyListeners.set(item, listener);
|
||||||
|
@ -206,11 +207,10 @@ export class Receptacle extends decorate(Trait) {
|
||||||
if (AVOCADO_SERVER) {
|
if (AVOCADO_SERVER) {
|
||||||
listeners.collisionStart = (other) => {
|
listeners.collisionStart = (other) => {
|
||||||
if (other.is('item')) {
|
if (other.is('item')) {
|
||||||
this.entity.addItemToSlot(other);
|
|
||||||
const slotIndex = this.itemSlotIndex(other);
|
|
||||||
if (other.is('listed')) {
|
if (other.is('listed')) {
|
||||||
other.list.removeEntity(other);
|
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
|
// CHEATING: assuming this entity is the informed
|
||||||
json: item.toNetwork(this.entity),
|
json: item.toNetwork(this.entity),
|
||||||
}));
|
}));
|
||||||
|
this.setDirty();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
this.entity.emit('inventoryChanged');
|
this.entity.emit('inventoryChanged');
|
||||||
|
@ -253,6 +254,7 @@ export class Receptacle extends decorate(Trait) {
|
||||||
firstSlotIndex: slotIndex,
|
firstSlotIndex: slotIndex,
|
||||||
secondSlotIndex: NULL_SLOT,
|
secondSlotIndex: NULL_SLOT,
|
||||||
}));
|
}));
|
||||||
|
this.setDirty();
|
||||||
}
|
}
|
||||||
this.entity.emit('inventoryChanged');
|
this.entity.emit('inventoryChanged');
|
||||||
return item;
|
return item;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user