fix: inventory self-swapping

This commit is contained in:
cha0s 2024-09-29 02:19:37 -05:00
parent 0cb5cdbe1f
commit 997ef691ca

View File

@ -215,8 +215,10 @@ export default class Inventory extends Component {
delete otherSlots[r];
}
Component.markChange(this.entity, 'swapped', [[l, OtherInventory.entity, r]]);
if (this.entity !== OtherInventory.entity) {
Component.markChange(OtherInventory.entity, 'swapped', [[r, this.entity, l]]);
}
}
toNet(recipient, data) {
if (recipient.id !== this.entity && this !== recipient.Player.openInventory) {
return {};