mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-30 03:32:47 +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;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
qsbItemSocket.RemoveFromSocket();
|
|
||||||
|
|
||||||
var player = QSBPlayerManager.GetPlayer(From);
|
var player = QSBPlayerManager.GetPlayer(From);
|
||||||
player.HeldItem = qsbItem;
|
player.HeldItem = qsbItem;
|
||||||
|
|
||||||
|
qsbItemSocket.RemoveFromSocket();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
case SocketMessageType.CompleteUnsocket:
|
case SocketMessageType.CompleteUnsocket:
|
||||||
|
@ -1,5 +1,7 @@
|
|||||||
using HarmonyLib;
|
using HarmonyLib;
|
||||||
using QSB.Patches;
|
using QSB.Patches;
|
||||||
|
using QSB.Player;
|
||||||
|
using System.Linq;
|
||||||
using UnityEngine;
|
using UnityEngine;
|
||||||
|
|
||||||
namespace QSB.ItemSync.Patches;
|
namespace QSB.ItemSync.Patches;
|
||||||
@ -150,5 +152,22 @@ internal class ItemRemotePatches : QSBPatch
|
|||||||
return false;
|
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
|
#endregion
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user