From 2badfa63e38c586dc22e1b64d1a093a650756a4e Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Sat, 31 Oct 2026 01:41:04 +0000 Subject: [PATCH] Decompile fn_23883 (CSession::IsCompanionAid) Batch #6692 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_23883 CSession::IsCompanionAid: logic confirmed by peer review Peer-reviewed-by: bigodeira, KWDev, Tanke Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Client/Session.h | 1 + Source/Client/SessionPredicates.cpp | 18 ++++++++++++++++++ 2 files changed, 19 insertions(+) diff --git a/Source/Client/Session.h b/Source/Client/Session.h index c65ccbfa..4cb1a78f 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -531,6 +531,7 @@ public: int IsLocalPlayerAid(std::uint32_t aid) const; bool IsHomunAid(std::uint32_t aid) const; bool IsMercenaryAid(std::uint32_t aid) const; + int IsCompanionAid(std::uint32_t aid) const; bool IsPetAid(std::uint32_t aid) const; bool IsEquipItemType(int type) const; bool IsMiscItemType(int type) const; diff --git a/Source/Client/SessionPredicates.cpp b/Source/Client/SessionPredicates.cpp index f4fec068..9c96c79c 100644 --- a/Source/Client/SessionPredicates.cpp +++ b/Source/Client/SessionPredicates.cpp @@ -95,6 +95,24 @@ bool CSession::IsMercenaryAid(std::uint32_t aid) const { return aid != 0xFFFFFFFF && aid == *reinterpret_cast(&this->unknown_5620[8]); } +// OFFSET: 0x00E1DE30 +// FUNCTION: fn_23883 +int CSession::IsCompanionAid(std::uint32_t aid) const { + if (aid == 0xFFFFFFFF) { + return 0; + } + if (aid == *reinterpret_cast(&this->unknown_5570[8]) || + aid == *reinterpret_cast(&this->unknown_5620[8]) || aid == this->unknown_1010 || + aid == static_cast(this->unknown_5BC0)) { + return 1; + } + auto it = this->unknown_0784.find(aid); + if (it == this->unknown_0784.end() || it->second == -1) { + return 0; + } + return 1; +} + // OFFSET: 0x00E1DF00 // FUNCTION: fn_23885 bool CSession::IsPetAid(std::uint32_t aid) const {