From e8b2f375ed2d810616ee538a3983b1d29f5ea160 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 6 Nov 2026 17:00:22 +0000 Subject: [PATCH] Decompile 10 functions in Source/Contents/Effects/RagEffect.cpp, Source/Contents/Items/ItemInfo.cpp, ... Batch #13444 by KWDev: 10 byte-identical, 0 confirmed by peer review. - fn_23807 CSession::GetPetFood: byte-identical - fn_23813 CSession::GetPetJobByEggItem: byte-identical - fn_23816 CSession::GetPetString: byte-identical - fn_20077 CRagEffect::LexDivina: byte-identical - fn_06573 ITEM_INFO::Assign: byte-identical - fn_07702 UIMessengerGroupWnd::DropMember: byte-identical - fn_10118 UIRPData::~UIRPData: byte-identical - fn_08276 CPlayerSkillBundle::RemoveExtra: byte-identical - fn_08129 CRuneSystemMgr::GetGradeFailValue: byte-identical - fn_02432 CSurfaceDX9::Resize: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Contents/Effects/RagEffect.cpp | 2 +- Source/Contents/Items/ItemInfo.cpp | 9 ++------- Source/Contents/Items/RuneSystem.cpp | 2 +- Source/Contents/Messenger/MessengerMember.cpp | 3 +-- Source/Contents/PetStrings.cpp | 18 +++++++++--------- Source/Contents/Skills/PlayerSkillBundle.cpp | 2 +- Source/Render/DX9/SurfaceDX9.cpp | 3 ++- Source/Render/Primitives/UIRPData.cpp | 6 ++++-- 8 files changed, 21 insertions(+), 24 deletions(-) diff --git a/Source/Contents/Effects/RagEffect.cpp b/Source/Contents/Effects/RagEffect.cpp index 8f8be1ac..69c48f9b 100644 --- a/Source/Contents/Effects/RagEffect.cpp +++ b/Source/Contents/Effects/RagEffect.cpp @@ -1999,7 +1999,7 @@ bool CRagEffect::LexDivina() { PlayEffectWave(*this, "effect\\priest_lexdivina.wav"); } - return this->ProcessEZ2STR(0.0f, -80.0f, 0.0f); + return this->ProcessEZ2STR(0.0f, -80.0f, 0.0f) ? true : false; } // OFFSET: 0x00C37A60 diff --git a/Source/Contents/Items/ItemInfo.cpp b/Source/Contents/Items/ItemInfo.cpp index 1bedc239..1497d21a 100644 --- a/Source/Contents/Items/ItemInfo.cpp +++ b/Source/Contents/Items/ItemInfo.cpp @@ -149,12 +149,7 @@ std::uint32_t ITEM_INFO::Assign(const RawItemData& item) { this->identified = item.identified; this->unknown_0060 = item.unknown_001C; - int count = 0; - if (item.optionCount <= 5) { - count = item.optionCount; - } - - this->unknown_0098 = count; + this->unknown_0098 = item.optionCount > 5 ? 0 : item.optionCount; for (int index = 0; index < this->unknown_0098; ++index) { std::memcpy(this->unknown_009C + index * 5, item.options + index * 5, 5); @@ -165,7 +160,7 @@ std::uint32_t ITEM_INFO::Assign(const RawItemData& item) { this->unknown_0000[2] = item.unknown_00B0; this->unknown_0070 = item.unknown_00B8; - return item.unknown_00B8; + return this->unknown_0070; } // OFFSET: 0x006D8A90 diff --git a/Source/Contents/Items/RuneSystem.cpp b/Source/Contents/Items/RuneSystem.cpp index 881703a4..432f73dc 100644 --- a/Source/Contents/Items/RuneSystem.cpp +++ b/Source/Contents/Items/RuneSystem.cpp @@ -290,7 +290,7 @@ int CRuneSystemMgr::GetCurSlotCount() const { int CRuneSystemMgr::GetGradeFailValue(RuneSetData* runeSet) { if (runeSet) { const auto found = this->m_gradeFailTypes.find(runeSet->m_gradeFailType); - if (this->m_gradeFailTypes.end() != found && static_cast(runeSet->m_grade) < found->second.size()) { + if (this->m_gradeFailTypes.end() != found && found->second.size() > static_cast(runeSet->m_grade)) { return found->second[runeSet->m_grade]; } } diff --git a/Source/Contents/Messenger/MessengerMember.cpp b/Source/Contents/Messenger/MessengerMember.cpp index d6a96591..3709b8d9 100644 --- a/Source/Contents/Messenger/MessengerMember.cpp +++ b/Source/Contents/Messenger/MessengerMember.cpp @@ -721,10 +721,9 @@ __declspec(noinline) void UIMessengerGroupWnd::DropMember(int x, int y, int inde int cell; if (x < g_windowMgr.unknown_4F238 + 23 && y > top) { int row = (y - top) / (g_windowMgr.unknown_4F23C + 3); + cell = row; if (g_windowMgr.FindSnapExcludedWindow(row)) { cell = g_windowMgr.FindMiniPartyCell(); - } else { - cell = row; } } else { cell = g_windowMgr.FindMiniPartyCell(); diff --git a/Source/Contents/PetStrings.cpp b/Source/Contents/PetStrings.cpp index 886720db..04590ffc 100644 --- a/Source/Contents/PetStrings.cpp +++ b/Source/Contents/PetStrings.cpp @@ -19,11 +19,11 @@ const char* CSession::GetPetAccActName(int id) { // FUNCTION: fn_23807 int CSession::GetPetFood(int job) { int food = 0; - if (!this->m_hotkeyScript->Call("GetPetFood", "d>d", job, &food)) { - return -1; + if (this->m_hotkeyScript->Call("GetPetFood", "d>d", job, &food)) { + return food; } - return food; + return -1; } // OFFSET: 0x00E0B170 @@ -41,20 +41,20 @@ void CSession::GetPetIllustName(int job, int, char* buffer) { // FUNCTION: fn_23813 int CSession::GetPetJobByEggItem(int eggItemId) { int job = 0; - if (!this->m_hotkeyScript->Call("GetPetJTID_by_PetEggITID", "d>d", eggItemId, &job)) { - return -1; + if (this->m_hotkeyScript->Call("GetPetJTID_by_PetEggITID", "d>d", eggItemId, &job)) { + return job; } - return job; + return -1; } // OFFSET: 0x00E12780 // FUNCTION: fn_23816 const char* CSession::GetPetString(int id) { const char* text = nullptr; - if (!this->m_hotkeyScript->Call("GetPetString", "d>s", id, &text)) { - return nullptr; + if (this->m_hotkeyScript->Call("GetPetString", "d>s", id, &text)) { + return text; } - return text; + return nullptr; } diff --git a/Source/Contents/Skills/PlayerSkillBundle.cpp b/Source/Contents/Skills/PlayerSkillBundle.cpp index f7b29c22..b3c285c1 100644 --- a/Source/Contents/Skills/PlayerSkillBundle.cpp +++ b/Source/Contents/Skills/PlayerSkillBundle.cpp @@ -181,7 +181,7 @@ void CPlayerSkillBundle::AddExtra(const CSkillInfo& value, WindowManagerWindows& // FUNCTION: fn_08276 bool CPlayerSkillBundle::RemoveExtra(std::uint32_t id) { for (auto entry = this->extra.begin(); entry != this->extra.end(); ++entry) { - if (entry->id != id) { + if (id != entry->id) { continue; } diff --git a/Source/Render/DX9/SurfaceDX9.cpp b/Source/Render/DX9/SurfaceDX9.cpp index cbc5bfa4..1fdfd8dd 100644 --- a/Source/Render/DX9/SurfaceDX9.cpp +++ b/Source/Render/DX9/SurfaceDX9.cpp @@ -96,8 +96,9 @@ bool CSurfaceDX9::Resize(int width, int height) { this->m_width = AlignDimension(width); this->m_height = AlignDimension(height); + const D3DFORMAT format = this->m_owner->backBufferDescription.Format; return SUCCEEDED(this->m_owner->device->CreateOffscreenPlainSurface( - this->m_width, this->m_height, this->m_owner->backBufferDescription.Format, D3DPOOL_DEFAULT, &this->m_surface, nullptr + this->m_width, this->m_height, format, D3DPOOL_DEFAULT, &this->m_surface, nullptr )) && this->m_surface; } diff --git a/Source/Render/Primitives/UIRPData.cpp b/Source/Render/Primitives/UIRPData.cpp index 6ea01416..e1e6f6ef 100644 --- a/Source/Render/Primitives/UIRPData.cpp +++ b/Source/Render/Primitives/UIRPData.cpp @@ -13,8 +13,10 @@ UIRPData::UIRPData() : m_texture(nullptr) { // OFFSET: 0x00812800 // FUNCTION: fn_10118 UIRPData::~UIRPData() { - delete this->m_texture; - this->m_texture = nullptr; + if (this->m_texture) { + delete this->m_texture; + this->m_texture = nullptr; + } this->m_primitives.clear(); }