diff --git a/QSB/ItemSync/WorldObjects/Items/IQSBItem.cs b/QSB/ItemSync/WorldObjects/Items/IQSBItem.cs index af9ab5a4..bb372a2a 100644 --- a/QSB/ItemSync/WorldObjects/Items/IQSBItem.cs +++ b/QSB/ItemSync/WorldObjects/Items/IQSBItem.cs @@ -9,4 +9,10 @@ public interface IQSBItem : IWorldObject void PickUpItem(Transform itemSocket); void DropItem(Vector3 position, Vector3 normal, Sector sector); void OnCompleteUnsocket(); + + /// + /// store the last location when a remote player drops/sockets us + /// so we can use it if they leave while still holding + /// + void StoreLocation(); } \ No newline at end of file diff --git a/QSB/ItemSync/WorldObjects/Items/QSBItem.cs b/QSB/ItemSync/WorldObjects/Items/QSBItem.cs index 6918e178..46798668 100644 --- a/QSB/ItemSync/WorldObjects/Items/QSBItem.cs +++ b/QSB/ItemSync/WorldObjects/Items/QSBItem.cs @@ -29,11 +29,7 @@ internal class QSBItem : WorldObject, IQSBItem public override void OnRemoval() => QSBPlayerManager.OnRemovePlayer -= OnPlayerLeave; - /// - /// store the last location when a remote player picks up an item - /// so we can use it if they leave before dropping/socketing it - /// - private void StoreLocation() + public void StoreLocation() { _lastParent = AttachedObject.transform.parent; _lastPosition = AttachedObject.transform.localPosition; @@ -80,11 +76,8 @@ internal class QSBItem : WorldObject, IQSBItem public ItemType GetItemType() => AttachedObject.GetItemType(); - public void PickUpItem(Transform holdTransform) - { - StoreLocation(); + public void PickUpItem(Transform holdTransform) => QSBPatch.RemoteCall(() => AttachedObject.PickUpItem(holdTransform)); - } public void DropItem(Vector3 position, Vector3 normal, Sector sector) => QSBPatch.RemoteCall(() => AttachedObject.DropItem(position, normal, sector.transform, sector, null));