From 82ecdee22f9496be293b206881a879e6abdad0ca Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 11 Nov 2026 11:26:00 +0000 Subject: [PATCH] Decompile 10 functions in Source/Contents/Effects/Core/EffectAttachments.cpp, Source/Contents/Items/ClientItemLists.cpp, ... Batch #16925 by KWDev: 10 byte-identical, 0 confirmed by peer review. - fn_21062 EffectActor::HasId: byte-identical - fn_23341 CSession::RemoveMerchantShopItem: byte-identical - fn_23351 CSession::RemoveCartItem: byte-identical - fn_19438 CNaviInfo::AddNpc: byte-identical - fn_19439 CNaviInfo::AddLink: byte-identical - fn_19440 CNaviInfo::AddMob: byte-identical - fn_19596 CNavigationManager::IsCurrentTarget: byte-identical - fn_10265 CBmpObjWnd::Paint: byte-identical - fn_10266 CSignBoardWnd::Paint: byte-identical - fn_17668 CWorld::GetGameActorByAID: byte-identical Merged automatically: every function is byte-identical to the original. --- .../Contents/Effects/Core/EffectAttachments.cpp | 4 ++-- Source/Contents/Items/ClientItemLists.cpp | 6 ++++-- Source/Contents/Navigation/NavigationLink.cpp | 15 +++++++++------ Source/Contents/Navigation/NavigationSource.cpp | 6 +++++- Source/Contents/SignBoard/SignBoard.cpp | 9 ++++++--- Source/Contents/World/WorldActors.cpp | 6 +++--- 6 files changed, 29 insertions(+), 17 deletions(-) diff --git a/Source/Contents/Effects/Core/EffectAttachments.cpp b/Source/Contents/Effects/Core/EffectAttachments.cpp index c904b1f0b..248614686 100644 --- a/Source/Contents/Effects/Core/EffectAttachments.cpp +++ b/Source/Contents/Effects/Core/EffectAttachments.cpp @@ -4,8 +4,8 @@ // OFFSET: 0x00CADBE0 // FUNCTION: fn_21062 bool EffectActor::HasId(int id) const { - for (const CRagEffect* effect : this->state.effects) { - if (effect && effect->state.type == id) { + for (auto it = this->state.effects.begin(); it != this->state.effects.end(); ++it) { + if (*it && (*it)->state.type == id) { return true; } } diff --git a/Source/Contents/Items/ClientItemLists.cpp b/Source/Contents/Items/ClientItemLists.cpp index 0557fe6a3..0fe9489dc 100644 --- a/Source/Contents/Items/ClientItemLists.cpp +++ b/Source/Contents/Items/ClientItemLists.cpp @@ -1546,8 +1546,9 @@ bool CSession::RemoveMerchantShopItem(const ITEM_INFO& item) { if (it->quantity <= 0) { this->merchantShopItems.erase(it); } + const std::uint32_t index = item.identity[1]; for (auto it2 = this->merchantShopItems.begin(); it2 != this->merchantShopItems.end(); ++it2) { - if (it2->identity[1] == item.identity[1]) { + if (it2->identity[1] == index) { it2->flags[2] = 0; break; } @@ -1677,8 +1678,9 @@ bool CSession::RemoveCartItem(const ITEM_INFO& item) { if (it->quantity <= 0) { this->cartItems.erase(it); } + const std::uint32_t index = item.identity[1]; for (auto it2 = this->cartItems.begin(); it2 != this->cartItems.end(); ++it2) { - if (it2->identity[1] == item.identity[1]) { + if (it2->identity[1] == index) { it2->flags[2] = 0; break; } diff --git a/Source/Contents/Navigation/NavigationLink.cpp b/Source/Contents/Navigation/NavigationLink.cpp index c963c83ff..d8efd9af8 100644 --- a/Source/Contents/Navigation/NavigationLink.cpp +++ b/Source/Contents/Navigation/NavigationLink.cpp @@ -84,11 +84,12 @@ void CNavi_Link::SetDepth(int depth) { bool CNaviInfo::AddNpc(CNavi_Object* npc) { std::vector& npcs = this->npcs; - if (npc == nullptr) { + CNavi_Object* object = npc; + if (object == nullptr) { return false; } - npcs.push_back(npc); + npcs.push_back(object); return true; } @@ -97,11 +98,12 @@ bool CNaviInfo::AddNpc(CNavi_Object* npc) { bool CNaviInfo::AddLink(CNavi_Link* link) { std::vector& links = this->links; - if (link == nullptr) { + CNavi_Link* object = link; + if (object == nullptr) { return false; } - links.push_back(link); + links.push_back(object); return true; } @@ -110,11 +112,12 @@ bool CNaviInfo::AddLink(CNavi_Link* link) { bool CNaviInfo::AddMob(CNavi_Object* mob) { std::vector& mobs = this->mobs; - if (mob == nullptr) { + CNavi_Object* object = mob; + if (object == nullptr) { return false; } - mobs.push_back(mob); + mobs.push_back(object); return true; } diff --git a/Source/Contents/Navigation/NavigationSource.cpp b/Source/Contents/Navigation/NavigationSource.cpp index df458e571..1f6a7d2f4 100644 --- a/Source/Contents/Navigation/NavigationSource.cpp +++ b/Source/Contents/Navigation/NavigationSource.cpp @@ -91,7 +91,11 @@ bool CNavigationManager::IsCurrentTarget(const char* name) const { } const std::string resolved = ResourceMgr::Instance().ResolveMapName(name); - return std::strcmp(info->GetName(), resolved.c_str()) == 0; + if (std::strcmp(info->GetName(), resolved.c_str()) == 0) { + return true; + } + + return false; } // OFFSET: 0x00B971D0 diff --git a/Source/Contents/SignBoard/SignBoard.cpp b/Source/Contents/SignBoard/SignBoard.cpp index 42ccf0b6a..c3c84335a 100644 --- a/Source/Contents/SignBoard/SignBoard.cpp +++ b/Source/Contents/SignBoard/SignBoard.cpp @@ -270,15 +270,18 @@ void CSignBoardWnd::OnCreate(int width, int height) { // OFFSET: 0x00821C50 // FUNCTION: fn_10265 void CBmpObjWnd::Paint() { - this->DrawBitmap(0, 0, static_cast(ResourceMgr::Instance().Load(Resolve(this->path.c_str()))), false); + CBitmapRes* bitmap = static_cast(ResourceMgr::Instance().Load(Resolve(this->path.c_str()))); + this->DrawBitmap(0, 0, bitmap, false); } // OFFSET: 0x00821C90 // FUNCTION: fn_10266 void CSignBoardWnd::Paint() { this->ClearSurface(0xFFFF00FF); - this->DrawBitmap(0, 0, static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\signboard\\bg_signboard.bmp"))), false); - this->DrawBitmap(5, 5, static_cast(ResourceMgr::Instance().Load(Resolve(this->iconPath.c_str()))), true); + CBitmapRes* background = static_cast(ResourceMgr::Instance().Load(Resolve("유저인터페이스\\signboard\\bg_signboard.bmp"))); + this->DrawBitmap(0, 0, background, false); + CBitmapRes* icon = static_cast(ResourceMgr::Instance().Load(Resolve(this->iconPath.c_str()))); + this->DrawBitmap(5, 5, icon, true); } // OFFSET: 0x00821D10 diff --git a/Source/Contents/World/WorldActors.cpp b/Source/Contents/World/WorldActors.cpp index 88b8e30af..37a79c833 100644 --- a/Source/Contents/World/WorldActors.cpp +++ b/Source/Contents/World/WorldActors.cpp @@ -5,9 +5,9 @@ // OFFSET: 0x00AC8260 // FUNCTION: fn_17668 CRenderObject* CWorld::GetGameActorByAID(std::uint32_t aid) const { - for (CRenderObject* actor : this->actors) { - if (actor->render.accountId == aid) { - return actor; + for (auto it = this->actors.begin(); it != this->actors.end(); ++it) { + if ((*it)->render.accountId == aid) { + return *it; } }