Added some checks for invalid numbers to love.math.setRandomState

--HG--
branch : RandomGenerator-2
This commit is contained in:
Alex Szpakowski
2013-08-04 17:04:52 -03:00
parent 0447d1e7c5
commit 674ad9247a
4 changed files with 52 additions and 13 deletions
+8 -1
View File
@@ -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;
}