using OWML.Utils; using QSB.ElevatorSync.WorldObjects; using QSB.Events; using QSB.Patches; using QSB.WorldSync; namespace QSB.ElevatorSync.Patches { public class ElevatorPatches : QSBPatch { public override QSBPatchTypes Type => QSBPatchTypes.OnModStart; public static void StartLift(Elevator __instance) { var isGoingUp = __instance.GetValue("_goingToTheEnd"); var id = QSBWorldSync.GetIdFromUnity(__instance); QSBEventManager.FireEvent(EventNames.QSBStartLift, id, isGoingUp); } public override void DoPatches() => QSBCore.HarmonyHelper.AddPostfix("StartLift", typeof(ElevatorPatches), nameof(StartLift)); public override void DoUnpatches() => QSBCore.HarmonyHelper.Unpatch("StartLift"); } }