1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Fix Lua PseudoRandom seeds being mangled

closes #14237
This commit is contained in:
sfan5 2024-01-10 20:00:14 +01:00
parent e83530d40b
commit d20f1182f2
2 changed files with 8 additions and 5 deletions

View file

@ -433,7 +433,7 @@ int LuaPseudoRandom::create_object(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
u64 seed = luaL_checknumber(L, 1);
s32 seed = luaL_checkinteger(L, 1);
LuaPseudoRandom *o = new LuaPseudoRandom(seed);
*(void **)(lua_newuserdata(L, sizeof(void *))) = o;
luaL_getmetatable(L, className);