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).
This commit is contained in:
ragnarok-clanker 2026-11-10 15:35:13 +00:00
commit 5cf376a64a

View file

@ -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;