Skip to content

Commit

Permalink
Optimise UpdateSlot to only send update packet
Browse files Browse the repository at this point in the history
  • Loading branch information
Kaioru committed Oct 1, 2024
1 parent e8815f1 commit e45d787
Showing 1 changed file with 11 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -121,8 +121,17 @@ public void UpdateSlot(short slot)
{
var item = this[slot];
if (item == null) return;
RemoveSlot(slot);
SetSlot(slot, item);

Operations.Enqueue(new StructuredModifyInventoryOperation
{
Type = ModifyInventoryOperationType.Add,
Info = new StructuredModifyInventoryOperationInfoAdd
{
Item = item.ToStructured(),
Inventory = type,
Slot = slot
}
});
}

public override short Add(ItemSlotBase item)
Expand Down

0 comments on commit e45d787

Please sign in to comment.