mirror of
https://github.com/misternebula/quantum-space-buddies.git
synced 2025-01-16 16:15:24 +00:00
33 lines
774 B
C#
33 lines
774 B
C#
using HarmonyLib;
|
|
using QSB.EchoesOfTheEye.Sarcophagus.Messages;
|
|
using QSB.EchoesOfTheEye.Sarcophagus.WorldObjects;
|
|
using QSB.Messaging;
|
|
using QSB.Patches;
|
|
using QSB.WorldSync;
|
|
|
|
namespace QSB.EchoesOfTheEye.Sarcophagus.Patches;
|
|
|
|
public class SarcophagusPatches : QSBPatch
|
|
{
|
|
public override QSBPatchTypes Type => QSBPatchTypes.OnClientConnect;
|
|
|
|
[HarmonyPrefix]
|
|
[HarmonyPatch(typeof(SarcophagusController), nameof(SarcophagusController.OnPressInteract))]
|
|
private static void OnPressInteract(SarcophagusController __instance)
|
|
{
|
|
if (Remote)
|
|
{
|
|
__instance.GetComponent<GearInterface>().OnPressInteract();
|
|
return;
|
|
}
|
|
|
|
if (!QSBWorldSync.AllObjectsReady)
|
|
{
|
|
return;
|
|
}
|
|
|
|
__instance.GetWorldObject<QSBSarcophagus>()
|
|
.SendMessage(new OpenMessage());
|
|
}
|
|
}
|