From 5d7cfb68eab9a293a99dab7468e2d84ed36a1211dfce7fd4845fb4c2dbdf40af Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=BB=A8=ED=8A=B8=EB=A1=A4DELTA?= Date: Tue, 26 May 2026 14:08:06 +0900 Subject: [PATCH] Improve `scrDecorationPatch` Code Consistency --- Patch/ClassPatch/scrDecorationPatch.cs | 28 +++++++------------------- 1 file changed, 7 insertions(+), 21 deletions(-) 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; } } }