From 2bc7be5c8e8dbc0416b2f56e6ce08ee88c19872d Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 11:22:07 +0000 Subject: [PATCH] Decompile 4 functions in Source/Contents/Items/RuneSystem.cpp Batch #12128 by Yommy: 0 byte-identical, 4 confirmed by peer review. - fn_08125 CRuneSystemMgr::GetDecomItem: logic confirmed by peer review - fn_08126 CRuneSystemMgr::GetOwnedDecomItem: logic confirmed by peer review - fn_08138 CTagData::FindRune: logic confirmed by peer review - fn_08161 CRuneSystemMgr::SetRewardStep: logic confirmed by peer review Peer-reviewed-by: KWDev, SapitoSucio, Toshiro Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Items/RuneSystem.cpp | 34 ++++++++++++---------------- 1 file changed, 14 insertions(+), 20 deletions(-) diff --git a/Source/Contents/Items/RuneSystem.cpp b/Source/Contents/Items/RuneSystem.cpp index 9d67cc46..ced8bf6a 100644 --- a/Source/Contents/Items/RuneSystem.cpp +++ b/Source/Contents/Items/RuneSystem.cpp @@ -256,21 +256,21 @@ const char* RuneData::GetName() const { // OFFSET: 0x00766CB0 // FUNCTION: fn_08125 int CRuneSystemMgr::GetDecomItem(unsigned int index) const { - if (index < this->m_decomItems.size()) { - return this->m_decomItems[index]; + if (index >= this->m_decomItems.size()) { + return 0; } - return 0; + return this->m_decomItems[index]; } // OFFSET: 0x00766CE0 // FUNCTION: fn_08126 int CRuneSystemMgr::GetOwnedDecomItem(unsigned int index) const { - if (index < this->m_ownedDecomItems.size()) { - return this->m_ownedDecomItems[index]; + if (index >= this->m_ownedDecomItems.size()) { + return 0; } - return 0; + return this->m_ownedDecomItems[index]; } // OFFSET: 0x00766DB0 @@ -389,16 +389,14 @@ RuneData* CRuneSystemMgr::FindRune(int tagId, int type, std::int64_t id, unsigne // FUNCTION: fn_08138 RuneData* CTagData::FindRune(int type, std::int64_t id, unsigned int* index) { if (type == 0 || type == 1) { - std::vector& runes = this->m_runes[type]; - const unsigned int count = static_cast(runes.size()); + const unsigned int count = static_cast(this->m_runes[type].size()); for (unsigned int i = 0; i < count; ++i) { - RuneData* rune = runes[i]; - if (rune && id == rune->m_id) { + if (this->m_runes[type][i] && id == this->m_runes[type][i]->m_id) { if (index) { *index = i; } - return runes[i]; + return this->m_runes[type][i]; } } } @@ -833,17 +831,13 @@ bool CRuneSystemMgr::SetRewardStep(int tagId, std::int64_t id, int step) { return false; } - std::vector& runes = tag->m_runes[0]; - const unsigned int count = static_cast(runes.size()); - for (unsigned int i = 0; i < count; ++i) { - RuneData* rune = runes[i]; - if (rune && id == rune->m_id) { - static_cast(rune)->m_rewardStep = step; - return true; - } + RuneSetData* runeSet = static_cast(tag->FindRune(0, id, nullptr)); + if (!runeSet) { + return false; } - return false; + runeSet->m_rewardStep = step; + return true; } // OFFSET: 0x00769240