From 5cf376a64a6419cd66a5f08dbcf549ac3b896dc8 Mon Sep 17 00:00:00 2001 From: ragnarok-clanker Date: Tue, 10 Nov 2026 15:35:13 +0000 Subject: [PATCH] Confirm fn_06922 (CCloud::Drift) Batch #15946 by eAthena: 0 byte-identical, 1 confirmed by peer review. - fn_06922 CCloud::Drift: logic confirmed by peer review (already on main) Peer-reviewed-by: Yommy, alisonrag, Toshiro Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes). --- Source/Contents/Effects/CloudEffect.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/Source/Contents/Effects/CloudEffect.cpp b/Source/Contents/Effects/CloudEffect.cpp index e2efdfd2a..08c1dba48 100644 --- a/Source/Contents/Effects/CloudEffect.cpp +++ b/Source/Contents/Effects/CloudEffect.cpp @@ -17,16 +17,14 @@ namespace { __forceinline void StepDrift(int& angle, int& target) { int goal = target; if (goal > angle) { - const int next = std::min(360, angle + 1); - angle = next; - if (goal < next) { - goal = next ? std::max(rand() % next, 0) : 0; + angle = std::min(360, angle + 1); + if (goal < angle) { + goal = angle == 0 ? 0 : std::max(rand() % angle, 0); } } else { - const int next = std::max(0, angle - 1); - angle = next; - if (goal >= next) { - goal = 360 - (next ? std::max(rand() % next, 0) : 0); + angle = std::max(0, angle - 1); + if (goal >= angle) { + goal = 360 - (angle == 0 ? 0 : std::max(rand() % angle, 0)); } } target = goal;