From e8767a37e7f3dc33fd089cf70e5669fd6b066c9b Mon Sep 17 00:00:00 2001 From: Jesper Arvidsson Date: Tue, 6 Jan 2026 21:46:44 +0100 Subject: [PATCH 1/3] Apply fix --- soh/soh/Enhancements/customequipment.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index 9834836fbc8..e305b2159da 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -24,7 +24,7 @@ static const char* ResolveCustomChain(std::initializer_list paths) for (auto path : paths) { if (path != nullptr) { fallback = path; - if (ResourceMgr_FileExists(path)) { + if (ResourceGetIsCustomByName(path) || ResourceMgr_FileExists(path)) { return path; } } From d160f579daf3428ad9d08a304aa734cc4d8212e0 Mon Sep 17 00:00:00 2001 From: Jesper Arvidsson Date: Wed, 7 Jan 2026 22:17:41 +0100 Subject: [PATCH 2/3] Add debugs --- soh/soh/Enhancements/customequipment.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index e305b2159da..c5f1a4e9c41 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -1,4 +1,5 @@ #include +#include #include "src/overlays/actors/ovl_En_Elf/z_en_elf.h" #include "objects/object_link_boy/object_link_boy.h" #include "objects/object_link_child/object_link_child.h" @@ -113,6 +114,7 @@ static void RefreshCustomEquipment() { void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, const char* dlist2, const char* dlist3, const char* alternateDL) { if (resource == NULL || gfx == NULL || dlist1 == NULL || dlist2 == NULL) { + SPDLOG_DEBUG("CustomEquip: skip patch (null arg) res=%p gfx=%p d1=%p d2=%p", resource, gfx, dlist1, dlist2); return; } @@ -120,6 +122,7 @@ void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, c if (!altAssetsRuntime) { // Alt assets are off; ensure any prior patches using these names are reverted. + SPDLOG_DEBUG("CustomEquip: unpatch (alt assets off) res=%s", resource); ResourceMgr_UnpatchGfxByName(resource, dlist1); ResourceMgr_UnpatchGfxByName(resource, dlist2); if (dlist3 != NULL) { @@ -131,10 +134,13 @@ void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, c } if (!ResourceGetIsCustomByName(gfx)) { + SPDLOG_DEBUG("CustomEquip: skip patch (gfx not custom) gfx=%s", gfx); return; } if (alternateDL == NULL || ResourceGetIsCustomByName(alternateDL) || ResourceMgr_FileExists(alternateDL)) { + SPDLOG_DEBUG("CustomEquip: patch res=%s gfx=%s d1=%s d2=%s d3=%s alt=%s", resource, gfx, dlist1, dlist2, + dlist3 != NULL ? dlist3 : "null", alternateDL != NULL ? alternateDL : "null"); ResourceMgr_PatchCustomGfxByName(resource, dlist1, 0, gsSPDisplayListOTRFilePath(gfx)); if (dlist3 == NULL) { ResourceMgr_PatchCustomGfxByName(resource, dlist2, 1, gsSPEndDisplayList()); @@ -144,6 +150,8 @@ void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, c if (dlist3 != NULL) { ResourceMgr_PatchCustomGfxByName(resource, dlist3, 2, gsSPEndDisplayList()); } + } else { + SPDLOG_DEBUG("CustomEquip: skip patch (alternate missing) alt=%s", alternateDL); } } From fd6e6a9d90c7b2aa80fc81a05956ede7ab8132fc Mon Sep 17 00:00:00 2001 From: Jesper Arvidsson Date: Wed, 7 Jan 2026 22:32:48 +0100 Subject: [PATCH 3/3] fix debug --- soh/soh/Enhancements/customequipment.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index c5f1a4e9c41..c80d3f74c64 100644 --- a/soh/soh/Enhancements/customequipment.cpp +++ b/soh/soh/Enhancements/customequipment.cpp @@ -114,7 +114,7 @@ static void RefreshCustomEquipment() { void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, const char* dlist2, const char* dlist3, const char* alternateDL) { if (resource == NULL || gfx == NULL || dlist1 == NULL || dlist2 == NULL) { - SPDLOG_DEBUG("CustomEquip: skip patch (null arg) res=%p gfx=%p d1=%p d2=%p", resource, gfx, dlist1, dlist2); + SPDLOG_DEBUG("CustomEquip: skip patch (null arg) res={} gfx={} d1={} d2={}", resource, gfx, dlist1, dlist2); return; } @@ -122,7 +122,7 @@ void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, c if (!altAssetsRuntime) { // Alt assets are off; ensure any prior patches using these names are reverted. - SPDLOG_DEBUG("CustomEquip: unpatch (alt assets off) res=%s", resource); + SPDLOG_DEBUG("CustomEquip: unpatch (alt assets off) res={}", resource); ResourceMgr_UnpatchGfxByName(resource, dlist1); ResourceMgr_UnpatchGfxByName(resource, dlist2); if (dlist3 != NULL) { @@ -134,12 +134,12 @@ void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, c } if (!ResourceGetIsCustomByName(gfx)) { - SPDLOG_DEBUG("CustomEquip: skip patch (gfx not custom) gfx=%s", gfx); + SPDLOG_DEBUG("CustomEquip: skip patch (gfx not custom) gfx={}", gfx); return; } if (alternateDL == NULL || ResourceGetIsCustomByName(alternateDL) || ResourceMgr_FileExists(alternateDL)) { - SPDLOG_DEBUG("CustomEquip: patch res=%s gfx=%s d1=%s d2=%s d3=%s alt=%s", resource, gfx, dlist1, dlist2, + SPDLOG_DEBUG("CustomEquip: patch res={} gfx={} d1={} d2={} d3={} alt={}", resource, gfx, dlist1, dlist2, dlist3 != NULL ? dlist3 : "null", alternateDL != NULL ? alternateDL : "null"); ResourceMgr_PatchCustomGfxByName(resource, dlist1, 0, gsSPDisplayListOTRFilePath(gfx)); if (dlist3 == NULL) { @@ -151,7 +151,7 @@ void PatchOrUnpatch(const char* resource, const char* gfx, const char* dlist1, c ResourceMgr_PatchCustomGfxByName(resource, dlist3, 2, gsSPEndDisplayList()); } } else { - SPDLOG_DEBUG("CustomEquip: skip patch (alternate missing) alt=%s", alternateDL); + SPDLOG_DEBUG("CustomEquip: skip patch (alternate missing) alt={}", alternateDL); } }