From 0f3c2d7c78e0b1a99afccad77fffb9ffa29b07da Mon Sep 17 00:00:00 2001 From: GaryOderNichts <12049776+GaryOderNichts@users.noreply.github.com> Date: Tue, 20 Dec 2022 20:19:25 +0100 Subject: [PATCH] Fix gfx patching on 32-bit platforms (#2213) --- soh/soh/OTRGlobals.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 8d963d46b..d75eef2a2 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -867,6 +867,11 @@ extern "C" void ResourceMgr_PatchGfxByName(const char* path, const char* patchNa } }*/ + // Index refers to individual gfx words, which are half the size on 32-bit + if (sizeof(uintptr_t) < 8) { + index /= 2; + } + Gfx* gfx = (Gfx*)&res->instructions[index]; if (!originalGfx.contains(path) || !originalGfx[path].contains(patchName)) {