From 498483a238bf75318bc6d1f57efe7cc63e83e1ce Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 15:39:34 +0000 Subject: [PATCH] Decompile fn_07897 (EZeffectClip::Texture) Batch #16194 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_07897 EZeffectClip::Texture: logic confirmed by peer review Peer-reviewed-by: youko, kyoshi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Resource/EZeffectResource.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/Source/Resource/EZeffectResource.cpp b/Source/Resource/EZeffectResource.cpp index 4d2a87a0e..105eb8971 100644 --- a/Source/Resource/EZeffectResource.cpp +++ b/Source/Resource/EZeffectResource.cpp @@ -98,25 +98,25 @@ void CEZeffectRes::Unload() { // OFFSET: 0x0074D850 // FUNCTION: fn_07897 CTexture* EZeffectClip::Texture(int index) { - if (index >= this->textureCount) { - return g_texMgr.Default(); - } + if (index < this->textureCount) { + if (!this->textures[index]) { + std::string path = std::format("effect\\{}", this->names[index]); - if (!this->textures[index]) { - std::string path = std::format("effect\\{}", this->names[index]); + if (path.find_last_of('.') == std::string::npos) { + path.append(".bmp", 4); + } - if (path.find_last_of('.') == std::string::npos) { - path.append(".bmp", 4); + this->textures[index] = g_texMgr.Load(path.c_str(), 1, false, true, false); + + if (this->textures[index]) { + this->textures[index]->Retain(); + } } - this->textures[index] = g_texMgr.Load(path.c_str(), 1, false, true, false); - - if (this->textures[index]) { - this->textures[index]->Retain(); - } + return this->textures[index]; } - return this->textures[index]; + return g_texMgr.Default(); } // OFFSET: 0x0074D9A0