diff --git a/src/luaconsole.c b/src/luaconsole.c index a6d60ade8..b89e125ca 100644 --- a/src/luaconsole.c +++ b/src/luaconsole.c @@ -805,16 +805,16 @@ int luacon_graphics_update(int t, int i, int *pixel_mode, int *cola, int *colr, lua_pushinteger(l, *colb); lua_pcall(l, 4, 10, 0); - cache = luaL_optint(l, 2, 0); - *pixel_mode = luaL_optint(l, 3, *pixel_mode); - *cola = luaL_optint(l, 4, *cola); - *colr = luaL_optint(l, 5, *colr); - *colg = luaL_optint(l, 6, *colg); - *colb = luaL_optint(l, 7, *colb); - *firea = luaL_optint(l, 8, *firea); - *firer = luaL_optint(l, 9, *firer); - *fireg = luaL_optint(l, 10, *fireg); - *fireb = luaL_optint(l, 11, *fireb); + cache = luaL_optint(l, -10, 0); + *pixel_mode = luaL_optint(l, -9, *pixel_mode); + *cola = luaL_optint(l, -8, *cola); + *colr = luaL_optint(l, -7, *colr); + *colg = luaL_optint(l, -6, *colg); + *colb = luaL_optint(l, -5, *colb); + *firea = luaL_optint(l, -4, *firea); + *firer = luaL_optint(l, -3, *firer); + *fireg = luaL_optint(l, -2, *fireg); + *fireb = luaL_optint(l, -1, *fireb); lua_pop(l, 10); return cache; }