Decompile fn_19848 (CEffectPrim::PrimDriftingSquares)
Batch #15372 by Yommy: 0 byte-identical, 1 confirmed by peer review. - fn_19848 CEffectPrim::PrimDriftingSquares: logic confirmed by peer review Peer-reviewed-by: ragnarok-clanker, gordaoprogramas, 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
57c2d24098
commit
720c796410
1 changed files with 1 additions and 36 deletions
|
|
@ -4452,42 +4452,7 @@ bool CEffectPrim::PrimDriftingSquares() {
|
|||
}
|
||||
}
|
||||
|
||||
for (int pair = 0; pair < 8; ++pair) {
|
||||
float& current = slot.height[2 * pair];
|
||||
float& target = slot.height[2 * pair + 1];
|
||||
int next;
|
||||
if (target > current) {
|
||||
current += 3.0f;
|
||||
if (current > 359.0f) {
|
||||
current = 359.0f;
|
||||
}
|
||||
if (current <= target) {
|
||||
continue;
|
||||
}
|
||||
const int range = static_cast<int>(current);
|
||||
next = 0;
|
||||
if (range != 0) {
|
||||
const int value = std::rand() % range;
|
||||
next = value >= 0 ? value : 0;
|
||||
}
|
||||
} else {
|
||||
current -= 2.0f;
|
||||
if (current < 0.0f) {
|
||||
current = 0.0f;
|
||||
}
|
||||
if (target < current) {
|
||||
continue;
|
||||
}
|
||||
const int range = static_cast<int>(current);
|
||||
int pick = 0;
|
||||
if (range != 0) {
|
||||
const int value = std::rand() % range;
|
||||
pick = value >= 0 ? value : 0;
|
||||
}
|
||||
next = 359 - pick;
|
||||
}
|
||||
target = static_cast<float>(next);
|
||||
}
|
||||
DriftSlotAngles(slot, 8, 3.0f, 2.0f);
|
||||
|
||||
const char mode = slot.flag1[0];
|
||||
if (mode == 1) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue