From f87862c8f62c80c120a7b4e34d0ab2c324ed867a Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 5 Nov 2026 16:53:13 +0000 Subject: [PATCH] Decompile 5 functions in Source/Contents/Effects/Bash.cpp, Source/Contents/Effects/ElectricEffect.cpp, ... Batch #12525 by cremane: 0 byte-identical, 5 confirmed by peer review. - fn_07059 CMeteorEffect::Slot04: logic confirmed by peer review - fn_07102 CRectUpEffect::Slot03: logic confirmed by peer review - fn_18872 CBash::Slot03: logic confirmed by peer review - fn_18873 CBash::Slot04: logic confirmed by peer review - fn_19007 CElectricEffect::Slot04: logic confirmed by peer review Peer-reviewed-by: Yommy, gordaoprogramas, dori Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/Bash.cpp | 12 ++++++++---- Source/Contents/Effects/ElectricEffect.cpp | 3 ++- Source/Contents/Effects/MeteorEffect.cpp | 3 ++- Source/Contents/Effects/RectUpEffect.cpp | 2 +- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/Source/Contents/Effects/Bash.cpp b/Source/Contents/Effects/Bash.cpp index e0203e99..2c80fd02 100644 --- a/Source/Contents/Effects/Bash.cpp +++ b/Source/Contents/Effects/Bash.cpp @@ -103,7 +103,8 @@ bool CBash::Slot06() { // OFFSET: 0x00B42720 // FUNCTION: fn_18872 void CBash::Slot03() { - for (CParticle* particle : this->rays) { + for (auto it = this->rays.begin(); it != this->rays.end(); ++it) { + CParticle* particle = *it; float* values = &particle->unknown_0054; const int fadeFrame = static_cast(values[1]); const int limit = static_cast(values[2]); @@ -122,7 +123,8 @@ void CBash::Slot03() { particle->alpha = std::min(alpha, limit); } - for (CParticle* particle : this->sparks) { + for (auto it = this->sparks.begin(); it != this->sparks.end(); ++it) { + CParticle* particle = *it; float* values = &particle->unknown_0054; const int fadeFrame = static_cast(values[8]); const int limit = static_cast(values[6]); @@ -151,7 +153,8 @@ void CBash::Slot03() { // OFFSET: 0x00B42C40 // FUNCTION: fn_18873 void CBash::Slot04() { - for (CParticle* particle : this->rays) { + for (auto it = this->rays.begin(); it != this->rays.end(); ++it) { + CParticle* particle = *it; const int angle = static_cast(*reinterpret_cast(&particle->unknown_00C4)); const float scale = particle->scale; const float cosine = g_cosTable[angle]; @@ -198,7 +201,8 @@ void CBash::Slot04() { g_renderer->queues.Submit(&primitive, static_cast(particle->flags), g_renderer->fog.supported != 0, g_depthStart, g_depthEnd); } - for (CParticle* particle : this->sparks) { + for (auto it = this->sparks.begin(); it != this->sparks.end(); ++it) { + CParticle* particle = *it; const float* values = &particle->unknown_0054; const float angle = values[0]; const float width = values[3]; diff --git a/Source/Contents/Effects/ElectricEffect.cpp b/Source/Contents/Effects/ElectricEffect.cpp index 93043221..e86b9f4d 100644 --- a/Source/Contents/Effects/ElectricEffect.cpp +++ b/Source/Contents/Effects/ElectricEffect.cpp @@ -187,7 +187,8 @@ void CElectricEffect::Slot03() { // OFFSET: 0x00B4F930 // FUNCTION: fn_19007 void CElectricEffect::Slot04() { - for (CParticle* bolt : this->bolts) { + for (auto it = this->bolts.begin(); it != this->bolts.end(); ++it) { + CParticle* bolt = *it; if (bolt && static_cast(bolt->unknown_000C - 1) <= 17 && bolt->unknown_0008 > 0) { const int frame = bolt->unknown_000C; const int alpha = bolt->alpha; diff --git a/Source/Contents/Effects/MeteorEffect.cpp b/Source/Contents/Effects/MeteorEffect.cpp index f710711f..f8cb5bf9 100644 --- a/Source/Contents/Effects/MeteorEffect.cpp +++ b/Source/Contents/Effects/MeteorEffect.cpp @@ -132,7 +132,8 @@ void CMeteorEffect::Slot03() { // OFFSET: 0x00707CA0 // FUNCTION: fn_07059 void CMeteorEffect::Slot04() { - for (CParticle* particle : this->unknown_00CC) { + for (auto it = this->unknown_00CC.begin(); it != this->unknown_00CC.end(); ++it) { + CParticle* particle = *it; if ((particle->life == 0.0f || particle->life * 60.0f > static_cast(particle->unknown_00E8)) && particle) { static_cast(particle)->sub_B40F30(0); } diff --git a/Source/Contents/Effects/RectUpEffect.cpp b/Source/Contents/Effects/RectUpEffect.cpp index f5f0999a..c73291e4 100644 --- a/Source/Contents/Effects/RectUpEffect.cpp +++ b/Source/Contents/Effects/RectUpEffect.cpp @@ -38,7 +38,7 @@ void CRectUpEffect::Slot03() { particle->position.y = this->position[1] + particle->unknown_00D4; particle->position.z = this->position[2] + particle->unknown_00D8; - int& phase = *reinterpret_cast(particle->unknown_0050); + int& phase = particle->unknown_0050; phase += phase + 1 < 360 ? 1 : -359; if (particle->unknown_00E8 > this->unknown_00E4) { particle->alpha = std::max(particle->alpha - 2, 0);