rodecomp/Source/Contents/Effects/Particle.cpp
ragnarok-clanker 0e46ab665e Decompile fn_18809 (RandomRange)
Batch #2857 by youko: 0 byte-identical, 1 confirmed by peer review.

- fn_18809 RandomRange: logic confirmed by peer review

Peer-reviewed-by: ragnarok-clanker, willerthal
Accepted without human review: peers confirmed the logic ("same" ahead by at least 3, with 70% of the votes).
Adds to the build: Source/Contents/Effects/Particle.cpp
2026-10-29 19:36:50 +00:00

30 lines
648 B
C++

#include "Contents/Effects/Particle.h"
#include "Render/Primitives/RenderPrimitive.h"
#include "Render/Textures/TextureCache.h"
#include <cstdlib>
// OFFSET: 0x00B3C440
// FUNCTION: fn_18809
float RandomRange(float minimum, float maximum) {
if (minimum == maximum) {
return minimum;
}
const int low = static_cast<int>(minimum * 10.0f);
const int value = rand();
const int span = std::abs(low + static_cast<int>(maximum * -10.0f)) + 1;
return static_cast<float>(value % span + low) * 0.1f;
}
// OFFSET: 0x00B3F950
// OFFSET: 0x00B3FC10
// OFFSET: 0x00B3FC80
// OFFSET: 0x00B40120
// OFFSET: 0x00B40160
// OFFSET: 0x00B40190