fix: inventory self-swapping
This commit is contained in:
parent
0cb5cdbe1f
commit
997ef691ca
|
@ -215,7 +215,9 @@ 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]]);
|
||||||
Component.markChange(OtherInventory.entity, 'swapped', [[r, this.entity, l]]);
|
if (this.entity !== OtherInventory.entity) {
|
||||||
|
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) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user