From cc1ff450825fde1027a11e9f0d3dfa80da50ebcf Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 14:35:49 +0000 Subject: [PATCH] Decompile 4 functions in Source/Contents/Effects/RagEffect.cpp Batch #16163 by eAthena: 0 byte-identical, 4 confirmed by peer review. - fn_20291 CRagEffect::HealCloudRings: logic confirmed by peer review - fn_20302 CRagEffect::TorchDustRing: logic confirmed by peer review - fn_20305 CRagEffect::LineStreakKind: logic confirmed by peer review - fn_20330 CRagEffect::TexturedRisingOrbs: logic confirmed by peer review Peer-reviewed-by: Yommy, alisonrag, youko Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/RagEffect.cpp | 59 ++++++++++++--------------- 1 file changed, 25 insertions(+), 34 deletions(-) diff --git a/Source/Contents/Effects/RagEffect.cpp b/Source/Contents/Effects/RagEffect.cpp index 9897dd1b4..6f05f2920 100644 --- a/Source/Contents/Effects/RagEffect.cpp +++ b/Source/Contents/Effects/RagEffect.cpp @@ -3320,7 +3320,7 @@ void CRagEffect::TexturedScatterLow(const char* name, char flag) { void CRagEffect::TorchDustRing(const char* name, char kind, std::int16_t angle) { char path[64]; - this->render.position = this->state.parent->render.position; + CopyVector(this->render.position, this->state.parent->render.position); if (this->state.stateCnt != 0) { return; @@ -5742,47 +5742,44 @@ void CRagEffect::LineStreak(std::int16_t kind) { // OFFSET: 0x00C6EAF0 // FUNCTION: fn_20305 void CRagEffect::LineStreakKind(std::int16_t kind) { - const RenderObjectState& parent = this->state.parent->render; - this->render.position.x = parent.position.x; - this->render.position.y = parent.position.y; - this->render.position.z = parent.position.z; + CopyVector(this->render.position, this->state.parent->render.position); if (this->state.stateCnt != 0) { return; } - this->state.currentPrimitive = &CreateEffectParticle(*this, this->render, 56, 0.0f, 0.0f, 0.0f, WorldObjects())->state; - this->state.currentPrimitive->renderFlag = 5; - this->state.currentPrimitive->duration = this->state.duration; - AllocateTextures(*this->state.currentPrimitive); - this->state.currentPrimitive->textures[0] = g_texMgr.Load(kind < 10 ? "effect\\line3.tga" : "effect\\line3y.tga", 0, false, true, false); - this->state.currentPrimitive->slots[0].life = 0; - this->state.currentPrimitive->slots[1].life = 0; - this->state.currentPrimitive->slots[2].life = 0; - this->state.currentPrimitive->slots[3].life = 0; + this->state.lastPrim = CreateEffectParticle(*this, this->render, 56, 0.0f, 0.0f, 0.0f, WorldObjects()); + this->state.lastPrim->state.renderFlag = 5; + this->state.lastPrim->state.duration = this->state.duration; + this->state.lastPrim->state.textures = new CTexture*[this->state.lastPrim->state.totalTexture]; + this->state.lastPrim->state.textures[0] = g_texMgr.Load(kind < 10 ? "effect\\line3.tga" : "effect\\line3y.tga", 0, false, true, false); + this->state.lastPrim->state.slots[0].life = 0; + this->state.lastPrim->state.slots[1].life = 0; + this->state.lastPrim->state.slots[2].life = 0; + this->state.lastPrim->state.slots[3].life = 0; for (int index = 0; index < 4; ++index) { - this->state.currentPrimitive->slots[index].life = 1; - this->state.currentPrimitive->slots[index].process = 0; - this->state.currentPrimitive->slots[index].distance = 100.0f; + this->state.lastPrim->state.slots[index].life = 1; + this->state.lastPrim->state.slots[index].process = 0; + this->state.lastPrim->state.slots[index].distance = 100.0f; if (kind % 10 == 0) { - this->state.currentPrimitive->slots[index].height[0] = -15.0f - static_cast(ClampedRandom(11)); + this->state.lastPrim->state.slots[index].height[0] = -15.0f - static_cast(ClampedRandom(11)); } else if (kind % 10 == 1) { - this->state.currentPrimitive->slots[index].height[0] = static_cast(ClampedRandom(11)) + 15.0f; + this->state.lastPrim->state.slots[index].height[0] = static_cast(ClampedRandom(11)) + 15.0f; } - this->state.currentPrimitive->slots[index].height[1] = static_cast(ClampedRandom(200)); + this->state.lastPrim->state.slots[index].height[1] = static_cast(ClampedRandom(200)); if (kind < 10) { - this->state.currentPrimitive->slots[index].maxHeight = static_cast(ClampedRandom(4)) * 0.1f + 0.3f; - this->state.currentPrimitive->slots[index].height[2] = static_cast(ClampedRandom(31)) + 20.0f; - this->state.currentPrimitive->slots[index].flag1[0] = static_cast(ClampedRandom(3) + 30); - this->state.currentPrimitive->slots[index].height[3] = static_cast(ClampedRandom(21)) * 0.1f + 1.5f; + this->state.lastPrim->state.slots[index].maxHeight = static_cast(ClampedRandom(4)) * 0.1f + 0.3f; + this->state.lastPrim->state.slots[index].height[2] = static_cast(ClampedRandom(31)) + 20.0f; + this->state.lastPrim->state.slots[index].flag1[0] = static_cast(ClampedRandom(3) + 30); + this->state.lastPrim->state.slots[index].height[3] = static_cast(ClampedRandom(21)) * 0.1f + 1.5f; } Get_Angle( - this->state.deltaPos[0] - this->render.position.x, this->state.deltaPos[2] - this->render.position.z, &this->state.currentPrimitive->slots[index].riseAngle + this->state.deltaPos[0] - this->render.position.x, this->state.deltaPos[2] - this->render.position.z, &this->state.lastPrim->state.slots[index].riseAngle ); - this->state.currentPrimitive->slots[index].alphaB = 0; + this->state.lastPrim->state.slots[index].alphaB = 0; } } @@ -7287,10 +7284,7 @@ void CRagEffect::TexturedTripleOrbit(const char* name) { // OFFSET: 0x00C73BF0 // FUNCTION: fn_20330 void CRagEffect::TexturedRisingOrbs(const char* name, char kind) { - const RenderObjectState& parent = this->state.parent->render; - this->render.position.x = parent.position.x; - this->render.position.y = parent.position.y; - this->render.position.z = parent.position.z; + CopyVector(this->render.position, this->state.parent->render.position); if (this->state.stateCnt == 0) { const auto* player = reinterpret_cast(static_cast(g_modeMgr.GetGameMode())->scene->player); @@ -8992,10 +8986,7 @@ void CRagEffect::TexturedSpinShards(const char* name, char kind) { // OFFSET: 0x00C69B00 // FUNCTION: fn_20291 void CRagEffect::HealCloudRings() { - const RenderObjectState& parent = this->state.parent->render; - this->render.position.x = parent.position.x; - this->render.position.y = parent.position.y; - this->render.position.z = parent.position.z; + CopyVector(this->render.position, this->state.parent->render.position); if (this->state.stateCnt != 0) { return;