From 5de41877da34ab06df5fd5fcbeae87ea6ff4fb57 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Thu, 12 Nov 2026 11:28:07 +0000 Subject: [PATCH] Decompile fn_18870 (CBash::Open) Batch #17940 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_18870 CBash::Open: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, Yommy, bibinir Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/Skills/Bash.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/Source/Contents/Effects/Skills/Bash.cpp b/Source/Contents/Effects/Skills/Bash.cpp index f40148415..5e9ade8cd 100644 --- a/Source/Contents/Effects/Skills/Bash.cpp +++ b/Source/Contents/Effects/Skills/Bash.cpp @@ -73,18 +73,19 @@ void CBash::Open() { do { CParticle* particle = CreateParticle(reinterpret_cast(this->position), 1); const int angle = rand() % 360; - const float speed = static_cast(std::max(rand() % 60, 0) + 10) / 10.0f; + const int roll = rand() % 60; + const float speed = static_cast((roll >= 0 ? roll : 0) + 10) / 10.0f; const float acceleration = -(speed / static_cast(this->effectLifetime)) / 1.5f; const int width = rand() % 25; const int radius = rand() % 40; const int growth = rand() % 30; float* values = &particle->animationParameter; - values[0] = static_cast(std::max(angle, 0)); + values[0] = static_cast(angle >= 0 ? angle : 0); values[1] = speed; values[2] = acceleration; - values[3] = static_cast(std::max(width, 0) + 5) / 10.0f; - values[4] = static_cast(std::max(radius, 0) + 20); - values[5] = static_cast(std::max(growth, 0) + 20) / 10.0f; + values[3] = static_cast((width >= 0 ? width : 0) + 5) / 10.0f; + values[4] = static_cast((radius >= 0 ? radius : 0) + 20); + values[5] = static_cast((growth >= 0 ? growth : 0) + 20) / 10.0f; values[6] = 200.0f; values[7] = 20.0f; values[8] = static_cast(this->effectLifetime - this->effectLifetime / 3);