mirror of
https://github.com/luanti-org/luanti.git
synced 2025-08-11 17:51:04 +00:00
Handle LuaErrors in Lua -> C++ calls on LuaJIT
This commit is contained in:
parent
38d112033b
commit
49cec3f782
18 changed files with 113 additions and 134 deletions
|
@ -330,10 +330,10 @@ int LuaPseudoRandom::l_next(lua_State *L)
|
|||
max = luaL_checkinteger(L, 3);
|
||||
if(max < min){
|
||||
errorstream<<"PseudoRandom.next(): max="<<max<<" min="<<min<<std::endl;
|
||||
throw LuaError(L, "PseudoRandom.next(): max < min");
|
||||
throw LuaError(NULL, "PseudoRandom.next(): max < min");
|
||||
}
|
||||
if(max - min != 32767 && max - min > 32767/5)
|
||||
throw LuaError(L, "PseudoRandom.next() max-min is not 32767"
|
||||
throw LuaError(NULL, "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.");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue