From 2cfa4a4d5e04f8863c60c7fdb75c666fa474ce25 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Fri, 30 Oct 2026 10:37:36 +0000 Subject: [PATCH] Decompile 9 functions in Source/Contents/Actors/GameActor.cpp Batch #5336 by tayoba: 1 byte-identical, 8 confirmed by peer review. - fn_21050 MountedJob: logic confirmed by peer review (already on main) - fn_21051 CGameActor::GetEffectCounter: logic confirmed by peer review (already on main) - fn_21053 CGameActor::GetNameOffset: logic confirmed by peer review - fn_21054 CGameActor::GetNameHeight: logic confirmed by peer review (already on main) - fn_21056 CGameActor::GetElapsedFrames: logic confirmed by peer review (already on main) - fn_21066 CGameActor::HasPendingDamage: byte-identical - fn_21067 CGameActor::UpdateUnknown03E8: logic confirmed by peer review - fn_21068 CGameActor::IsPlayerClass: logic confirmed by peer review - fn_21072 CGameActor::SetStackedEffect: logic confirmed by peer review (already on main) Peer-reviewed-by: willerthal, KWDev, Bruwuno, eAthena, meitogi Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Actors/GameActor.cpp | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) diff --git a/Source/Contents/Actors/GameActor.cpp b/Source/Contents/Actors/GameActor.cpp index 417f2b70..f810340a 100644 --- a/Source/Contents/Actors/GameActor.cpp +++ b/Source/Contents/Actors/GameActor.cpp @@ -3,6 +3,7 @@ #include "Client/Session.h" #include "Contents/Actors/ActorStateFlags.h" #include "Contents/Actors/Pc.h" +#include "Contents/Jobs/JobInheritance.h" #include "Contents/MapSkyMgr.h" #include "Utility/Math/AffineMatrix.h" #include "Resource/Sprites/ActionResource.h" @@ -293,7 +294,7 @@ float CGameActor::GetNameOffset() { if (angle > 270) { scale = 0.5f; } else { - scale = (g_sinTable[angle] + 1.0f) * 0.25f + g_depthAverageHalf; + scale = (g_sinTable[angle >= 90 ? angle : 90] + 1.0f) * 0.25f + g_depthAverageHalf; } } @@ -479,22 +480,27 @@ bool CGameActor::IsMonsterClass(int job) { // OFFSET: 0x00CADCC0 // FUNCTION: fn_21066 bool CGameActor::HasPendingDamage() { - return !this->unknown_02A8.empty(); + return this->unknown_02A8.size() > 0; } // OFFSET: 0x00CADCF0 // FUNCTION: fn_21067 bool CGameActor::UpdateUnknown03E8(std::int64_t value) { - const std::int64_t previous = (static_cast(this->unknown_03EC) << 32) | static_cast(this->unknown_03E8); - this->unknown_03EC = static_cast(value >> 32); - this->unknown_03E8 = static_cast(value); - return previous < value; + bool result = false; + const int high = static_cast(value >> 32); + const unsigned int low = static_cast(value); + if (this->unknown_03EC <= high && (this->unknown_03EC < high || static_cast(this->unknown_03E8) < low)) { + result = true; + } + this->unknown_03EC = high; + this->unknown_03E8 = static_cast(low); + return result; } // OFFSET: 0x00CADD30 // FUNCTION: fn_21068 int CGameActor::IsPlayerClass(int job) { - return g_session.IsPlayerJobId(job); + return IsPlayerJob(job); } // OFFSET: 0x00CAE1B0