fix: inventory self-swapping
This commit is contained in:
parent
0cb5cdbe1f
commit
997ef691ca
|
@ -215,8 +215,10 @@ export default class Inventory extends Component {
|
||||||
delete otherSlots[r];
|
delete otherSlots[r];
|
||||||
}
|
}
|
||||||
Component.markChange(this.entity, 'swapped', [[l, OtherInventory.entity, r]]);
|
Component.markChange(this.entity, 'swapped', [[l, OtherInventory.entity, r]]);
|
||||||
|
if (this.entity !== OtherInventory.entity) {
|
||||||
Component.markChange(OtherInventory.entity, 'swapped', [[r, this.entity, l]]);
|
Component.markChange(OtherInventory.entity, 'swapped', [[r, this.entity, l]]);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
toNet(recipient, data) {
|
toNet(recipient, data) {
|
||||||
if (recipient.id !== this.entity && this !== recipient.Player.openInventory) {
|
if (recipient.id !== this.entity && this !== recipient.Player.openInventory) {
|
||||||
return {};
|
return {};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user