mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-17 01:13:05 +00:00
StoreLocation: make interface method so we can call it in patches when we do that
This commit is contained in:
parent
ba196896c4
commit
0e3978ecbc
@ -9,4 +9,10 @@ public interface IQSBItem : IWorldObject
|
||||
void PickUpItem(Transform itemSocket);
|
||||
void DropItem(Vector3 position, Vector3 normal, Sector sector);
|
||||
void OnCompleteUnsocket();
|
||||
|
||||
/// <summary>
|
||||
/// store the last location when a remote player drops/sockets us
|
||||
/// so we can use it if they leave while still holding
|
||||
/// </summary>
|
||||
void StoreLocation();
|
||||
}
|
@ -29,11 +29,7 @@ internal class QSBItem<T> : WorldObject<T>, IQSBItem
|
||||
|
||||
public override void OnRemoval() => QSBPlayerManager.OnRemovePlayer -= OnPlayerLeave;
|
||||
|
||||
/// <summary>
|
||||
/// store the last location when a remote player picks up an item
|
||||
/// so we can use it if they leave before dropping/socketing it
|
||||
/// </summary>
|
||||
private void StoreLocation()
|
||||
public void StoreLocation()
|
||||
{
|
||||
_lastParent = AttachedObject.transform.parent;
|
||||
_lastPosition = AttachedObject.transform.localPosition;
|
||||
@ -80,11 +76,8 @@ internal class QSBItem<T> : WorldObject<T>, 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));
|
||||
|
Loading…
Reference in New Issue
Block a user