mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-29 00:32:43 +00:00
SlideReelSocket.RemoveFromSocket
This commit is contained in:
parent
7b9036f3d0
commit
edfa31d73e
@ -44,10 +44,10 @@ internal class SocketItemMessage : QSBMessage<(SocketMessageType Type, int Socke
|
||||
return;
|
||||
}
|
||||
|
||||
qsbItemSocket.RemoveFromSocket();
|
||||
|
||||
var player = QSBPlayerManager.GetPlayer(From);
|
||||
player.HeldItem = qsbItem;
|
||||
|
||||
qsbItemSocket.RemoveFromSocket();
|
||||
return;
|
||||
}
|
||||
case SocketMessageType.CompleteUnsocket:
|
||||
|
@ -1,5 +1,7 @@
|
||||
using HarmonyLib;
|
||||
using QSB.Patches;
|
||||
using QSB.Player;
|
||||
using System.Linq;
|
||||
using UnityEngine;
|
||||
|
||||
namespace QSB.ItemSync.Patches;
|
||||
@ -150,5 +152,22 @@ internal class ItemRemotePatches : QSBPatch
|
||||
return false;
|
||||
}
|
||||
|
||||
[HarmonyPrefix]
|
||||
[HarmonyPatch(typeof(SlideReelSocket), nameof(SlideReelSocket.RemoveFromSocket))]
|
||||
private static bool SlideReelSocket_RemoveFromSocket(SlideReelSocket __instance, ref OWItem __result)
|
||||
{
|
||||
if (!Remote)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
var socketedItem = (SlideReelItem)__instance._socketedItem;
|
||||
var player = QSBPlayerManager.PlayerList.First(x => x.HeldItem.AttachedObject == socketedItem);
|
||||
socketedItem.SetSocketLocalDir(__instance.CalcCorrectUnsocketDir(player.Camera.transform));
|
||||
__result = OWItemSocket_RemoveFromSocket(__instance);
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user