diff --git a/soh/soh/Enhancements/customequipment.cpp b/soh/soh/Enhancements/customequipment.cpp index 9834836fbc8..c80d3f74c64 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" @@ -24,7 +25,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; } } @@ -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={} gfx={} d1={} d2={}", 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={}", 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={}", gfx); return; } if (alternateDL == NULL || ResourceGetIsCustomByName(alternateDL) || ResourceMgr_FileExists(alternateDL)) { + 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) { 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={}", alternateDL); } }