mirror of
https://github.com/luanti-org/luanti.git
synced 2025-10-14 09:05:19 +02:00
Pass a errfunc to lua_pcall to get a traceback
This commit is contained in:
@@ -333,7 +333,10 @@ int LuaPseudoRandom::l_next(lua_State *L)
|
||||
throw LuaError(L, "PseudoRandom.next(): max < min");
|
||||
}
|
||||
if(max - min != 32767 && max - min > 32767/5)
|
||||
throw LuaError(L, "PseudoRandom.next() max-min is not 32767 and is > 32768/5. This is disallowed due to the bad random distribution the implementation would otherwise make.");
|
||||
throw LuaError(L, "PseudoRandom.next() max-min is not 32767"
|
||||
" and is > 32768/5. This is disallowed due to"
|
||||
" the bad random distribution the"
|
||||
" implementation would otherwise make.");
|
||||
PseudoRandom &pseudo = o->m_pseudo;
|
||||
int val = pseudo.next();
|
||||
val = (val % (max-min+1)) + min;
|
||||
|
Reference in New Issue
Block a user