mirror of
https://github.com/love2d/love.git
synced 2026-08-12 16:40:57 +02:00
Added some checks for invalid numbers to love.math.setRandomState
--HG-- branch : RandomGenerator-2
This commit is contained in:
@@ -34,7 +34,14 @@ namespace math
|
||||
|
||||
int w_setRandomState(lua_State *L)
|
||||
{
|
||||
Math::instance.setRandomState(luax_checkrandomstate(L, 1));
|
||||
try
|
||||
{
|
||||
Math::instance.setRandomState(luax_checkrandomstate(L, 1));
|
||||
}
|
||||
catch (love::Exception &e)
|
||||
{
|
||||
return luaL_error(L, "%s", e.what());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user