MCPcopy Create free account
hub / github.com/DFHack/dfhack / dfhack_random_random

Function dfhack_random_random

library/LuaApi.cpp:1145–1155  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1143}
1144
1145static int dfhack_random_random(lua_State *L)
1146{
1147 MersenneRNG *prng = check_random_native(L, 1);
1148
1149 lua_settop(L, 2);
1150 if (lua_gettop(L) < 2 || lua_isnil(L, 2))
1151 lua_pushunsigned(L, prng->random());
1152 else
1153 lua_pushunsigned(L, prng->random(luaL_optunsigned(L, 2, 0)));
1154 return 1;
1155}
1156
1157static int dfhack_random_drandom(lua_State *L)
1158{

Callers

nothing calls this directly

Calls 3

check_random_nativeFunction · 0.85
lua_settopFunction · 0.85
lua_gettopFunction · 0.85

Tested by

no test coverage detected