Decompile 2 functions in Source/Contents/Sound/SoundMaker.cpp, Source/Contents/Actors/GameActor.h, ...

Batch #5232 by youko: 0 byte-identical, 2 confirmed by peer review.

- fn_22398 CCorpse::OnProcess: logic confirmed by peer review
- fn_22412 CHalluNPC::Render: logic confirmed by peer review

Peer-reviewed-by: eAthena, zindokar
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
This commit is contained in:
ragnarok-clanker 2026-10-30 09:40:57 +00:00
commit 153ed5b346
3 changed files with 69 additions and 1 deletions

View file

@ -18,6 +18,7 @@ class CCorpse : public CRenderObject {
public:
CCorpse();
~CCorpse() override;
bool OnProcess() override;
void SendMsg(
CGameObject* sender, int message, int a, int b, int c, int d, int e, int f, int g, int h, int i, int j, int k, int l, int m
) override;

View file

@ -90,7 +90,9 @@ public:
/* 0288 */ int unknown_0288;
/* 028C */ unsigned char unknown_028C[0x04];
/* 0290 */ int unknown_0290;
/* 0294 */ unsigned char unknown_0294[0x0C];
/* 0294 */ int unknown_0294;
/* 0298 */ int unknown_0298;
/* 029C */ unsigned char unknown_029C[0x04];
/* 02A0 */ std::list<ActorDamageMessage> unknown_02A0;
/* 02A8 */ std::list<ActorDamageMessage> unknown_02A8;
/* 02B0 */ int unknown_02B0;
@ -304,6 +306,7 @@ static_assert(offsetof(CGameActor, unknown_023C) == 0x23C);
static_assert(offsetof(CGameActor, unknown_0258) == 0x258);
static_assert(offsetof(CGameActor, unknown_0264) == 0x264);
static_assert(offsetof(CGameActor, unknown_0290) == 0x290);
static_assert(offsetof(CGameActor, unknown_0298) == 0x298);
static_assert(offsetof(CGameActor, unknown_02A0) == 0x2A0);
static_assert(offsetof(CGameActor, unknown_02A8) == 0x2A8);
static_assert(offsetof(CGameActor, unknown_02B8) == 0x2B8);

View file

@ -1,5 +1,6 @@
#include "Contents/Sound/SoundMaker.h"
#include "Contents/Actors/ActorStateFlags.h"
#include "Contents/Actors/EffectActors.h"
#include "Contents/Actors/GndRiser.h"
#include "Contents/Actors/Npc.h"
@ -8,15 +9,21 @@
#include "Client/Mode/ModeMgr.h"
#include "Client/Mode/CGameMode.h"
#include "Client/Session.h"
#include "Contents/Configuration/ServiceOptions.h"
#include "Contents/Skills/ClientSkills.h"
#include "Contents/World/World.h"
#include "UI/Window/UIWindowMgr.h"
#include "Resource/ResourceMgr.h"
#include "Resource/Sprites/ActionResource.h"
#include "Resource/World/WorldResource.h"
#include "Render/Renderer.h"
#include "Render/SpriteGeometry.h"
#include "Utility/Math/AffineMatrix.h"
#include "Utility/Math/ScalarConversion.h"
#include <cmath>
#include <cstdio>
#include <cstdlib>
#include <windows.h>
#include <timeapi.h>
@ -676,3 +683,60 @@ bool CHalluPC::OnProcess() {
}
return true;
}
// OFFSET: 0x00DA3010
// FUNCTION: fn_22398
bool CCorpse::OnProcess() {
const float elapsed = static_cast<float>((timeGetTime() - this->render.unknown_008C) / 24.0);
this->render.previousAnimation = this->Get8Dir(this->render.angle) + this->render.animation;
this->render.curMotion = this->GetActRes()->FrameCount(this->render.previousAnimation) - 1;
this->SetColor(static_cast<int>(255.0f - elapsed), -1, -1, -1);
return elapsed < 255.0f;
}
// OFFSET: 0x00DA4160
// FUNCTION: fn_22412
void CHalluNPC::Render(int argument) {
const float* matrix = reinterpret_cast<const float*>(argument);
if (StateFlag02(this->stateFlags) || StateFlag06(this->stateFlags) || StateFlag01(this->stateFlags)) {
return;
}
rand();
rand();
rand();
rand();
if (this->GetEffectiveJob(-1) >= 6017 && this->GetEffectiveJob(-1) <= 6046) {
if (!this->render.visible) {
this->UpdateTlvertex(matrix);
return;
}
if ((this->render.color & 0xFF000000) == 0xFF000000) {
this->DrawShadow(argument, this->render.scale);
}
if (this->render.enabled) {
this->RenderMercenary(matrix, this->GetEffectiveJob(-1));
} else {
this->UpdateTlvertex(matrix);
}
return;
}
if (!this->render.visible) {
this->UpdateTlvertex(matrix);
return;
}
if (this->render.unknown_0070 != 6 && this->render.unknown_0070 != 3) {
this->DrawShadow(argument, this->render.scale);
}
if (this->render.enabled) {
this->DrawSprite(argument, this->IsMonsterClass(this->GetEffectiveJob(-1)), 0.0f);
} else {
this->UpdateTlvertex(matrix);
}
}
// OFFSET: 0x00DA44D0