From 4bc01ecc560b75a517fba51d9f50f8ecf7655aec Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 07:04:38 +0000 Subject: [PATCH] Decompile fn_07036 (CHitLineEffect::Open) Batch #15575 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_07036 CHitLineEffect::Open: logic confirmed by peer review Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/HitLineEffect.cpp | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) diff --git a/Source/Contents/Effects/HitLineEffect.cpp b/Source/Contents/Effects/HitLineEffect.cpp index 0d736c751..350a9a4d6 100644 --- a/Source/Contents/Effects/HitLineEffect.cpp +++ b/Source/Contents/Effects/HitLineEffect.cpp @@ -7,6 +7,15 @@ #include #include +struct HitLineVector3d : vector3d { + // INLINED + HitLineVector3d() { + this->x = 0.0f; + this->y = 0.0f; + this->z = 0.0f; + } +}; + // OFFSET: 0x00705040 // FUNCTION: fn_07035 void CHitLineEffect::Close() { @@ -22,9 +31,9 @@ void CHitLineEffect::Close() { void CHitLineEffect::Open() { for (int pass = 0; pass < 4; ++pass) { for (int line = 0; line < 4; ++line) { - const int delay = -std::max(rand() % 26, 0); - const int brightness = std::max(rand() % 51, 0) + 125; - const int angle = std::max(rand() % 360, 0); + const int delay = -std::max(0, rand() % 26); + const int brightness = std::max(0, rand() % 51) + 125; + const int angle = std::max(0, rand() % 360); for (int segment = 0; segment < 20; ++segment) { CParticle* particle = CreateParticle(reinterpret_cast(this->position), 5); if (particle) { @@ -38,11 +47,9 @@ void CHitLineEffect::Open() { *reinterpret_cast(particle->effectParameters) = brightness; particle->phaseParameter = angle; particle->speedParameter = 14.0f; - float* turns = &particle->animationParameter; - unsigned char* halfTurns = &particle->animationState; for (int index = 0; index < 21; ++index) { - halfTurns[index] = 0; - turns[index] = 0.0f; + (&particle->animationState)[index] = 0; + (&particle->animationParameter)[index] = 0.0f; } InitParticleQuad(particle->vertices); this->particles.push_back(particle);