diff options
Diffstat (limited to 'lmathlib.c')
| -rw-r--r-- | lmathlib.c | 4 |
1 files changed, 2 insertions, 2 deletions
| @@ -607,8 +607,8 @@ static int math_randomseed (lua_State *L) { | |||
| 607 | RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1)); | 607 | RanState *state = (RanState *)lua_touserdata(L, lua_upvalueindex(1)); |
| 608 | lua_Unsigned n1, n2; | 608 | lua_Unsigned n1, n2; |
| 609 | if (lua_isnone(L, 1)) { | 609 | if (lua_isnone(L, 1)) { |
| 610 | n1 = luaL_makeseed(L); | 610 | n1 = luaL_makeseed(L); /* "random" seed */ |
| 611 | n2 = I2UInt(state->s[0]); | 611 | n2 = I2UInt(nextrand(state->s)); /* in case seed is not that random... */ |
| 612 | } | 612 | } |
| 613 | else { | 613 | else { |
| 614 | n1 = luaL_checkinteger(L, 1); | 614 | n1 = luaL_checkinteger(L, 1); |
