From bdc35c078b24921ebb8ce781ef2b636cbfe10445 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 10:04:54 +0000 Subject: [PATCH] Decompile 7 functions in Source/Archive/PakRegistry.cpp, Source/Client/Mode/GameMode.cpp, ... Batch #18143 by KWDev: 7 byte-identical, 0 confirmed by peer review. - fn_18111 PakRegistry::Add: byte-identical - fn_21283 CGameMode::LocationText: byte-identical - fn_05320 CAchievementMgr::GetCompletedCount: byte-identical - fn_18965 CSquareRangeEffect::OnProcess: byte-identical - fn_07545 CWindEffect::Render: byte-identical - fn_18179 ResourceMgr::ResolveMapName: byte-identical - fn_02765 Split: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Archive/PakRegistry.cpp | 2 +- Source/Client/Mode/GameMode.cpp | 3 ++- Source/Contents/Achievement/AchievementMgr.cpp | 12 ++++++++---- Source/Contents/Effects/Core/SquareRangeEffect.cpp | 2 +- Source/Contents/Effects/Skills/WindEffect.cpp | 9 ++++++++- Source/Resource/ResourceAliases.cpp | 3 ++- Source/Utility/Text/StringUtil.cpp | 3 ++- 7 files changed, 24 insertions(+), 10 deletions(-) diff --git a/Source/Archive/PakRegistry.cpp b/Source/Archive/PakRegistry.cpp index 898e83722..9224f0110 100644 --- a/Source/Archive/PakRegistry.cpp +++ b/Source/Archive/PakRegistry.cpp @@ -22,7 +22,7 @@ bool PakRegistry::Add(const char* filename) { CGPak* archive = new CGPak; CMemMapPakFile* file = new CMemMapPakFile(filename); - this->m_archives.emplace_front(file, archive); + this->m_archives.push_front(std::make_pair(file, archive)); return this->m_archives.front().second->Open(this->m_archives.front().first); } diff --git a/Source/Client/Mode/GameMode.cpp b/Source/Client/Mode/GameMode.cpp index f4a01dcd5..0cc8f148f 100644 --- a/Source/Client/Mode/GameMode.cpp +++ b/Source/Client/Mode/GameMode.cpp @@ -454,7 +454,8 @@ std::string CGameMode::LocationText() { } std::sprintf(text, "Location: %s ( %d , %d )", name.c_str(), column, row); - return text; + std::string result(text); + return result; } // OFFSET: 0x00CD5800 diff --git a/Source/Contents/Achievement/AchievementMgr.cpp b/Source/Contents/Achievement/AchievementMgr.cpp index 971f12b8a..6b04e2823 100644 --- a/Source/Contents/Achievement/AchievementMgr.cpp +++ b/Source/Contents/Achievement/AchievementMgr.cpp @@ -171,16 +171,20 @@ int CAchievementMgr::GetCompletedCount(int group, int index) { } else if (index == -1) { for (int i = 0; i < this->groupWidth; ++i) { int key = this->groupWidth * group + i; - for (std::vector::iterator it = this->groups[key].begin(); it != this->groups[key].end(); ++it) { - if (IsAchievementCompleted(*it)) { + for (std::vector::iterator it = this->groups[key].begin(); it != this->groups[key].end();) { + const int id = *it; + ++it; + if (IsAchievementCompleted(id)) { ++count; } } } } else { int key = this->groupWidth * group + index; - for (std::vector::iterator it = this->groups[key].begin(); it != this->groups[key].end(); ++it) { - if (IsAchievementCompleted(*it)) { + for (std::vector::iterator it = this->groups[key].begin(); it != this->groups[key].end();) { + const int id = *it; + ++it; + if (IsAchievementCompleted(id)) { ++count; } } diff --git a/Source/Contents/Effects/Core/SquareRangeEffect.cpp b/Source/Contents/Effects/Core/SquareRangeEffect.cpp index b96270275..b8ac82f88 100644 --- a/Source/Contents/Effects/Core/SquareRangeEffect.cpp +++ b/Source/Contents/Effects/Core/SquareRangeEffect.cpp @@ -73,7 +73,7 @@ void CSquareRangeEffect::OnProcess() { matrix rotation; std::memcpy(rotation.values, g_identityMatrix, sizeof(rotation.values)); - rotation.MakeXRotation(1.5707964f); + rotation.MakeXRotation(1.570796f); matrix scale; std::memcpy(scale.values, g_identityMatrix, sizeof(scale.values)); scale.SetScale(particle->scale, particle->scale, 1.0f); diff --git a/Source/Contents/Effects/Skills/WindEffect.cpp b/Source/Contents/Effects/Skills/WindEffect.cpp index 83d99049c..0484a6589 100644 --- a/Source/Contents/Effects/Skills/WindEffect.cpp +++ b/Source/Contents/Effects/Skills/WindEffect.cpp @@ -180,7 +180,14 @@ void CWindEffect::Render() { continue; } - const ParticleQuad quad = {true, 0.0f, 1.0f, static_cast(texPart - 1) / 21.0f, static_cast(texPart) / 21.0f, false, true}; + ParticleQuad quad; + quad.unused = false; + quad.depth = true; + quad.top = 0.0f; + quad.bottom = 1.0f; + quad.billboard = true; + quad.left = static_cast(texPart - 1) / 21.0f; + quad.right = static_cast(texPart) / 21.0f; particle->Render(quad); } } diff --git a/Source/Resource/ResourceAliases.cpp b/Source/Resource/ResourceAliases.cpp index ec5189576..a1dfd68b4 100644 --- a/Source/Resource/ResourceAliases.cpp +++ b/Source/Resource/ResourceAliases.cpp @@ -50,7 +50,8 @@ std::string ResourceMgr::ResolveMapName(const char* name) const { filename += ".gat"; const char* resolved = this->Resolve(filename.c_str()); const char* extension = std::strstr(resolved, ".gat"); - return std::string(resolved, extension); + std::string mapName(resolved, extension); + return mapName; } // OFFSET: 0x00AEFE50 diff --git a/Source/Utility/Text/StringUtil.cpp b/Source/Utility/Text/StringUtil.cpp index 79b36c7b8..52d31b0f1 100644 --- a/Source/Utility/Text/StringUtil.cpp +++ b/Source/Utility/Text/StringUtil.cpp @@ -173,7 +173,8 @@ std::string FormatDecimal(double value, int precision, bool trimZeros) { std::vector Split(std::string_view text, std::string_view delimiter) { auto parts = text | std::views::split(delimiter) | std::views::transform([](auto&& part) { return std::string_view(part.begin(), part.end()); }); - return std::vector(parts.begin(), parts.end()); + std::vector result(parts.begin(), parts.end()); + return result; } // OFFSET: 0x0058B830