MCPcopy Create free account
hub / github.com/ZDoom/Raze / NativeRandom

Function NativeRandom

source/common/scripting/backend/codegen.cpp:6191–6198  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6189//==========================================================================
6190
6191static int NativeRandom(FRandom *rng, int min, int max)
6192{
6193 if (max < min)
6194 {
6195 std::swap(max, min);
6196 }
6197 return (*rng)(max - min + 1) + min;
6198}
6199
6200DEFINE_ACTION_FUNCTION_NATIVE(DObject, BuiltinRandom, NativeRandom)
6201{

Callers 1

Calls 1

swapFunction · 0.85

Tested by

no test coverage detected