From 39e5860ee88653e69eacc772fc397976d343077c Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 09:54:20 +0000 Subject: [PATCH] Decompile fn_24221 (CSession::UpdateBodyStyle) Batch #2016 by ragnarok-clanker: 0 byte-identical, 1 confirmed by peer review. - fn_24221 CSession::UpdateBodyStyle: logic confirmed by peer review Reviewed-by: ragnarok-clanker --- Source/Client/Session.h | 4 +++- Source/Contents/ClientState.cpp | 12 ++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Source/Client/Session.h b/Source/Client/Session.h index e8db795..23bf45e 100644 --- a/Source/Client/Session.h +++ b/Source/Client/Session.h @@ -88,7 +88,8 @@ public: /* 0E98 */ int unknown_0E98; /* 0E9C */ unsigned char unknown_0E9C[0x3C]; /* 0ED8 */ int m_head; - /* 0EDC */ unsigned char unknown_0EDC[0x14]; + /* 0EDC */ unsigned char unknown_0EDC[0x10]; + /* 0EEC */ int m_bodyStyle; /* 0EF0 */ int m_headPalette; /* 0EF4 */ unsigned char unknown_0EF4[0x0C]; /* 0F00 */ int m_robe; @@ -291,6 +292,7 @@ public: void ClearItemSelection(); bool IsDoramJob(int job) const; bool IsSecondJob(int job); + void UpdateBodyStyle(int job, int style, int renderJob); std::string GetBodyJobName(int job); char* ConvertTooltipText(const char* source, char* output) const; void StoreEmblem(const void* data, std::size_t size, std::uint32_t guildId, int version); diff --git a/Source/Contents/ClientState.cpp b/Source/Contents/ClientState.cpp index cfe416a..5075b20 100644 --- a/Source/Contents/ClientState.cpp +++ b/Source/Contents/ClientState.cpp @@ -13,6 +13,18 @@ bool g_homunculusAutoFeed; // GLOBAL: gl_24493 bool g_petAutoFeed; +// OFFSET: 0x00E488C0 +// FUNCTION: fn_24221 +void CSession::UpdateBodyStyle(int job, int style, int renderJob) { + if (style >= 2 || this->IsSecondJob(renderJob)) { + this->m_bodyStyle = style; + } else if (static_cast(job - 4001) <= 21) { + this->m_bodyStyle = job <= 4007; + } else { + this->m_bodyStyle = static_cast(job - 4001) <= 6; + } +} + // OFFSET: 0x00E48930 // FUNCTION: fn_24222 void CSession::SetHomunculusAutoFeed(bool enabled) {