diff --git a/Patch/ClassPatch/scrDecorationPatch.cs b/Patch/ClassPatch/scrDecorationPatch.cs index 08c65cd..b4866dd 100644 --- a/Patch/ClassPatch/scrDecorationPatch.cs +++ b/Patch/ClassPatch/scrDecorationPatch.cs @@ -1,5 +1,4 @@ using HarmonyLib; -using UnityEngine; namespace ADOFAIRenderer.Patch.ClassPatch { @@ -12,44 +11,31 @@ namespace ADOFAIRenderer.Patch.ClassPatch // ReSharper disable once InconsistentNaming public static bool SetRotationPrefix(scrDecoration __instance) { - if (__instance == null || !__instance || __instance.pivotTrans == null) - { - return false; - } - return true; + return __instance != null && __instance && __instance.pivotTrans != null; } [HarmonyPrefix] [HarmonyPatch("SetScale")] + // ReSharper disable once InconsistentNaming public static bool SetScalePrefix(scrDecoration __instance) { - if (__instance == null || !__instance || __instance.pivotTrans == null) - { - return false; - } - return true; + return __instance != null && __instance && __instance.pivotTrans != null; } [HarmonyPrefix] [HarmonyPatch("SetOpacity")] + // ReSharper disable once InconsistentNaming public static bool SetOpacityPrefix(scrDecoration __instance) { - if (__instance == null || !__instance) - { - return false; - } - return true; + return __instance != null && __instance; } [HarmonyPrefix] [HarmonyPatch("UpdatePosition")] + // ReSharper disable once InconsistentNaming public static bool UpdatePositionPrefix(scrDecoration __instance) { - if (__instance == null || !__instance || __instance.pivotTrans == null) - { - return false; - } - return true; + return __instance != null && __instance && __instance.pivotTrans != null; } } }