Permalink
Browse files

Merge pull request #1488 from mugmuggy/randomOne

[RDY] Fix math.random with one parameter call
  • Loading branch information...
TheCycoONE committed Nov 19, 2018
2 parents e14d4ff + 072270d commit c97629ed0bef3d027a4fc2f518e394a0c0151bab
Showing with 1 addition and 1 deletion.
  1. +1 −1 CorsixTH/Src/random.c
@@ -145,7 +145,7 @@ static int l_random(lua_State *L)
case 1:
max = (uint32_t)luaL_checkinteger(L, 1);
luaL_argcheck(L, 1 <= max, 1, "interval is empty");
lua_pushinteger(L, (lua_Integer)(genrand_int32() % max));
lua_pushinteger(L, 1 + (lua_Integer)(genrand_int32() % max));
break;
case 0:
lua_pushnumber(L, (lua_Number)genrand_res53());

0 comments on commit c97629e

Please sign in to comment.