diff --git a/soh/soh/OTRGlobals.cpp b/soh/soh/OTRGlobals.cpp index 2b53078f9..272102e97 100644 --- a/soh/soh/OTRGlobals.cpp +++ b/soh/soh/OTRGlobals.cpp @@ -888,6 +888,12 @@ extern "C" char* ResourceMgr_LoadFileRaw(const char* resName) { // TODO: This should not exist. Anywhere we are loading textures with this function should be Resources instead. // We are not currently packing our otr archive with certain textures as resources with otr headers. static std::unordered_map> cachedRawFiles; + + auto cacheFind = cachedRawFiles.find(resName); + if (cacheFind != cachedRawFiles.end()) { + return cacheFind->second->Buffer.data(); + } + auto file = OTRGlobals::Instance->context->GetResourceManager()->LoadFile(resName); cachedRawFiles[resName] = file;