From cb0d9c1c9cc4ea0ca46626d6587566e0ae8cfebc71cfe4afe444d15904664e93 Mon Sep 17 00:00:00 2001 From: copecone Date: Sat, 8 Aug 2026 22:54:31 +0900 Subject: [PATCH] Add Safety Checks and Exception Handling to Game Patches --- Patch/Game/scnEditorPatch.cs | 6 ++++++ Patch/Game/scrFloorPatch.cs | 7 +++++++ Patch/Game/scrPortalParticlesPatch.cs | 2 ++ Util/FFmpegVideoBGPlayer.cs | 3 ++- 4 files changed, 17 insertions(+), 1 deletion(-) create mode 100644 Patch/Game/scrFloorPatch.cs diff --git a/Patch/Game/scnEditorPatch.cs b/Patch/Game/scnEditorPatch.cs index d73286e..263f782 100644 --- a/Patch/Game/scnEditorPatch.cs +++ b/Patch/Game/scnEditorPatch.cs @@ -1,5 +1,6 @@ using ADOFAIRenderer.Core; using HarmonyLib; +using MelonLoader; using UnityEngine; using UnityEngine.UI; @@ -15,6 +16,11 @@ namespace ADOFAIRenderer.Patch.Game public static void AddButtonRender(scnEditor __instance) { if (RenderMod.IsFeatureDisabled) return; + if (!__instance || !__instance.buttonExit) + { + Melon.Logger.Msg("scnEditor에 렌더 버튼을 만들 수 없습니다."); + return; + } var cloneTarget = __instance.buttonExit!.gameObject; var buttonContainer = cloneTarget.transform.parent!; diff --git a/Patch/Game/scrFloorPatch.cs b/Patch/Game/scrFloorPatch.cs new file mode 100644 index 0000000..68189bb --- /dev/null +++ b/Patch/Game/scrFloorPatch.cs @@ -0,0 +1,7 @@ +namespace ADOFAIRenderer.Patch.Game +{ + public class scrFloorPatch + { + + } +} \ No newline at end of file diff --git a/Patch/Game/scrPortalParticlesPatch.cs b/Patch/Game/scrPortalParticlesPatch.cs index 1a07347..2441042 100644 --- a/Patch/Game/scrPortalParticlesPatch.cs +++ b/Patch/Game/scrPortalParticlesPatch.cs @@ -1,3 +1,4 @@ +using ADOFAIRenderer.Core; using HarmonyLib; using UnityEngine; @@ -12,6 +13,7 @@ namespace ADOFAIRenderer.Patch.Game // ReSharper disable once InconsistentNaming public static void ForceScaledTime(scrPortalParticles __instance) { + if (!RenderManager.IsActive) return; if (__instance == null) return; var particleSystems = __instance.GetComponentsInChildren(true); diff --git a/Util/FFmpegVideoBGPlayer.cs b/Util/FFmpegVideoBGPlayer.cs index 6cbf54e..7127191 100644 --- a/Util/FFmpegVideoBGPlayer.cs +++ b/Util/FFmpegVideoBGPlayer.cs @@ -133,7 +133,8 @@ namespace ADOFAIRenderer.Util break; default: - throw new ArgumentOutOfRangeException(); + Melon.Logger.Msg("[FFmpegVideoBGPlayer] 색공간 변환에 Compute Shader를 사용할 수 없습니다."); + break; } }