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:
parent
cb761f6ee5
commit
5cf376a64a
1 changed files with 6 additions and 8 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue