From 9c91fdd272b680f52b54f0f39de53afe22d51234 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Wed, 11 Nov 2026 21:59:40 +0000 Subject: [PATCH] Decompile fn_23461 (CSession::GetRealWeaponId) Batch #17356 by eAthena: 1 byte-identical, 0 confirmed by peer review. - fn_23461 CSession::GetRealWeaponId: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Client/Session/Session.h | 2 ++ Source/Contents/Actors/RenderObject.cpp | 2 +- Source/Contents/Jobs/JobInheritance.cpp | 6 +++--- Source/Contents/Jobs/JobInheritance.h | 2 -- Source/Contents/Sound/HitSounds.cpp | 6 +++--- Source/Contents/Sound/SoundMaker.cpp | 2 +- 6 files changed, 10 insertions(+), 10 deletions(-) diff --git a/Source/Client/Session/Session.h b/Source/Client/Session/Session.h index 3183a6060..0157154f1 100644 --- a/Source/Client/Session/Session.h +++ b/Source/Client/Session/Session.h @@ -715,6 +715,8 @@ public: bool IsCostumeJob(int job) const; int GetSiegeMode() const; int IsPlayerJobId(int job) const; + bool IsVisibleJob(int job) const; + int GetRealWeaponId(int weapon) const; int GetBattleFieldMode() const; bool IsShadowItemType(int type) const; bool IsConsumableItemType(int type) const; diff --git a/Source/Contents/Actors/RenderObject.cpp b/Source/Contents/Actors/RenderObject.cpp index 1e23d85e5..d1793e35e 100644 --- a/Source/Contents/Actors/RenderObject.cpp +++ b/Source/Contents/Actors/RenderObject.cpp @@ -2737,7 +2737,7 @@ void CCharacterNpc::SendMsg( switch (static_cast(a) << 32 | static_cast(message)) { case AM_INITSTANDENTRY: this->EffectActor::SendMsg(sender, message, a, b, c, d, e, f, g, h, i, 0, 0, 0, 0); - this->render.visible = IsVisibleJob(info->job) ? 1 : 0; + this->render.visible = g_session.IsVisibleJob(info->job) ? 1 : 0; this->SetGuildInfo(info->guildId, info->guildEmblemVersion); if (this->characterRender != nullptr) { return; diff --git a/Source/Contents/Jobs/JobInheritance.cpp b/Source/Contents/Jobs/JobInheritance.cpp index 453362b13..1d5bce3c7 100644 --- a/Source/Contents/Jobs/JobInheritance.cpp +++ b/Source/Contents/Jobs/JobInheritance.cpp @@ -774,7 +774,7 @@ void CSession::InitializeSkillTree() { // OFFSET: 0x00DE0830 // FUNCTION: fn_23461 -int __stdcall GetRealWeaponId(int weapon) { +int CSession::GetRealWeaponId(int weapon) const { int real = 0; if (g_session.m_hotkeyScript->Call("GetRealWeaponId", "d>d", weapon, &real)) { return real; @@ -798,7 +798,7 @@ bool __stdcall IsJobWeaponAllowed(int job, int slot, std::int64_t weapon) { } } - const std::int64_t view = GetRealWeaponId(static_cast(weapon)); + const std::int64_t view = g_session.GetRealWeaponId(static_cast(weapon)); bool result = false; switch (job) { @@ -1202,7 +1202,7 @@ std::string CSession::GetWeaponSprName(int job, int sex, int weapon, int weaponI // OFFSET: 0x00DFBE10 // FUNCTION: fn_23590 -bool __stdcall IsVisibleJob(int job) { +bool CSession::IsVisibleJob(int job) const { return job != JT_WARPNPC && job != JT_EFFECTLAUNCHER && job != JT_HIDDEN_NPC; } diff --git a/Source/Contents/Jobs/JobInheritance.h b/Source/Contents/Jobs/JobInheritance.h index 243f9e683..054384307 100644 --- a/Source/Contents/Jobs/JobInheritance.h +++ b/Source/Contents/Jobs/JobInheritance.h @@ -5,11 +5,9 @@ #include int __stdcall IsPlayerJob(int job); -bool __stdcall IsVisibleJob(int job); int __stdcall GetWeaponViewValue(int weapon); int __stdcall GetDualWieldWeaponType(int first, int second); bool __stdcall IsJobWeaponAllowed(int job, int slot, std::int64_t weapon); -int __stdcall GetRealWeaponId(int weapon); std::string GetJobTitleString(int job); bool ResetHotkeySlots(); bool IsScreenShakeActive(); diff --git a/Source/Contents/Sound/HitSounds.cpp b/Source/Contents/Sound/HitSounds.cpp index 1c0429bab..1b391bcd5 100644 --- a/Source/Contents/Sound/HitSounds.cpp +++ b/Source/Contents/Sound/HitSounds.cpp @@ -9,7 +9,7 @@ // OFFSET: 0x00DDE3D0 // FUNCTION: fn_23395 const char* CSession::GetHitWaveName(int job) { - if (!((job >= 31 && job < 1000) || job < 0 || (job > 1000 && job < 3999) || (job >= 20021 && job <= 31999))) { + if (!((job >= 31 && job < 1000) || job < 0 || (job > 1000 && job < 3999) || static_cast(job - 20021) <= 11978)) { const std::vector& jobWaves = reinterpret_cast&>(this->weaponSoundTables[0x0C]); if (job > 3950) { return jobWaves.begin()[job - 3950].c_str(); @@ -17,7 +17,7 @@ const char* CSession::GetHitWaveName(int job) { return jobWaves.begin()[job].c_str(); } - const int weapon = GetRealWeaponId(-1); + const int weapon = g_session.GetRealWeaponId(-1); if (weapon == -1) { switch (std::max(std::rand() % 4, 0)) { case 0: @@ -59,7 +59,7 @@ const char* CSession::GetHitWaveName(int job) { // OFFSET: 0x00DE3680 // FUNCTION: fn_23481 const char* CSession::GetWeaponHitWaveName(int weapon) { - const int realWeapon = GetRealWeaponId(weapon); + const int realWeapon = g_session.GetRealWeaponId(weapon); if (realWeapon == -1) { switch (std::max(std::rand() % 4, 0)) { case 0: diff --git a/Source/Contents/Sound/SoundMaker.cpp b/Source/Contents/Sound/SoundMaker.cpp index 22ef6f58d..fc5343fda 100644 --- a/Source/Contents/Sound/SoundMaker.cpp +++ b/Source/Contents/Sound/SoundMaker.cpp @@ -738,7 +738,7 @@ void CNpc::SendMsg( this->emblemVersion = info->ownerId; break; } - this->render.visible = IsVisibleJob(info->job); + this->render.visible = g_session.IsVisibleJob(info->job); this->SetGuildInfo(info->guildId, info->guildVersion); return; }