diff --git a/lualib-src/lua-multicast.c b/lualib-src/lua-multicast.c index 4588bd10f..dab90ee2a 100644 --- a/lualib-src/lua-multicast.c +++ b/lualib-src/lua-multicast.c @@ -141,7 +141,8 @@ static int mc_nextid(lua_State *L) { uint32_t id = (uint32_t)luaL_checkinteger(L, 1); id += 256; - lua_pushinteger(L, (uint32_t)id); + // remove the highest bit, see #1139 + lua_pushinteger(L, id & 0x7fffffffu); return 1; }