From b7fce8bdd9e6308789ff1ea40b58438123b8bcbe Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 29 Oct 2026 00:59:59 +0000 Subject: [PATCH] Decompile 2 functions in Source/Contents/Effects/EffectPrimitiveMotion.cpp, Source/Contents/Effects/EffectParticle.h Batch #1992 by ragnarok-clanker: 2 byte-identical, 0 confirmed by peer review. - fn_19966 EffectParticle::FollowMasterAndAdvance: byte-identical - fn_19952 EffectParticle::FollowMasterAndTickSlots: byte-identical Merged automatically: every function is byte-identical to the original. --- Source/Contents/Effects/EffectParticle.h | 3 ++ .../Effects/EffectPrimitiveMotion.cpp | 33 +++++++++++++++++++ 2 files changed, 36 insertions(+) diff --git a/Source/Contents/Effects/EffectParticle.h b/Source/Contents/Effects/EffectParticle.h index 3d80679..8b0b20a 100644 --- a/Source/Contents/Effects/EffectParticle.h +++ b/Source/Contents/Effects/EffectParticle.h @@ -44,6 +44,9 @@ struct EffectParticle : CRenderObject { void PrimWaterFall(); bool AdvanceFrame(); + bool FollowMasterAndAdvance(); + void FollowMasterAndTickSlots(); + void FollowMasterAndTickSlots2(); void UpdateRecords(); /* 0138 */ EffectPrimitiveState state; diff --git a/Source/Contents/Effects/EffectPrimitiveMotion.cpp b/Source/Contents/Effects/EffectPrimitiveMotion.cpp index 9b9f85d..e9322b2 100644 --- a/Source/Contents/Effects/EffectPrimitiveMotion.cpp +++ b/Source/Contents/Effects/EffectPrimitiveMotion.cpp @@ -2266,3 +2266,36 @@ void EffectParticle::UpdateRecords() { const std::uint32_t blue = static_cast(this->state.blue); first.color = (static_cast(static_cast(this->state.alpha)) << 24) | (red << 16) | (green << 8) | blue; } + +// INLINED +static void FollowMaster(EffectParticle& particle) { + const AttachedEffect* master = particle.state.master; + particle.render.position.x = master->render.position.x; + particle.render.position.y = master->render.position.y; + particle.render.position.z = master->render.position.z; +} + +// INLINED +static void TickLiveSlots(EffectPrimitiveSlot* slots) { + for (int index = 0; index < 4; ++index) { + if (slots[index].life == 1) { + ++slots[index].process; + } + } +} + +// OFFSET: 0x00BEB020 +// FUNCTION: fn_19966 +bool EffectParticle::FollowMasterAndAdvance() { + FollowMaster(*this); + return this->AdvanceFrame(); +} + +// OFFSET: 0x00BE9560 +// FUNCTION: fn_19952 +void EffectParticle::FollowMasterAndTickSlots() { + FollowMaster(*this); + TickLiveSlots(this->state.slots); +} + +// OFFSET: 0x00BE8770