From 589750649f753442e8e10809e9bb82dbbd1cb70e Mon Sep 17 00:00:00 2001 From: JohnCorby Date: Sun, 12 Dec 2021 03:01:41 -0800 Subject: [PATCH] ShipDamageController_OnImpact NRE for real --- QSB/ShipSync/Patches/ShipPatches.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/QSB/ShipSync/Patches/ShipPatches.cs b/QSB/ShipSync/Patches/ShipPatches.cs index 279e873d..d0076458 100644 --- a/QSB/ShipSync/Patches/ShipPatches.cs +++ b/QSB/ShipSync/Patches/ShipPatches.cs @@ -206,7 +206,14 @@ namespace QSB.ShipSync.Patches [HarmonyPrefix] [HarmonyPatch(typeof(ShipDamageController), nameof(ShipDamageController.OnImpact))] public static bool ShipDamageController_OnImpact() - => ShipManager.Instance && ShipManager.Instance.HasAuthority; + { + if (!ShipManager.Instance) + { + return true; + } + + return ShipManager.Instance.HasAuthority; + } [HarmonyPostfix] [HarmonyPatch(typeof(ShipComponent), nameof(ShipComponent.RepairTick))]