Don't do fixed update if there is no cloak sphere shape

This commit is contained in:
Noah Pilarski 2022-09-11 04:27:36 -04:00
parent f145d5ccc8
commit 3a5b5f9b92

View File

@ -7,6 +7,13 @@ namespace NewHorizons.Patches
{ {
public static class CloakPatches public static class CloakPatches
{ {
[HarmonyPostfix]
[HarmonyPatch(typeof(CloakFieldController), nameof(CloakFieldController.FixedUpdate))]
public static bool CloakFieldController_FixedUpdate(CloakFieldController __instance)
{
return __instance._cloakSphereShape != null;
}
[HarmonyPostfix] [HarmonyPostfix]
[HarmonyPatch(typeof(CloakFieldController), nameof(CloakFieldController.isPlayerInsideCloak), MethodType.Getter)] [HarmonyPatch(typeof(CloakFieldController), nameof(CloakFieldController.isPlayerInsideCloak), MethodType.Getter)]
public static void CloakFieldController_isPlayerInsideCloak(CloakFieldController __instance, ref bool __result) public static void CloakFieldController_isPlayerInsideCloak(CloakFieldController __instance, ref bool __result)