summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacob1 <jfu614@gmail.com>2012-08-06 17:35:28 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2012-08-06 18:35:28 (GMT)
commit7e3c73f66f24924ab3e3e11f96c3bc02eb950260 (patch)
tree4dab5aafbf6b0da0ccfae234de0ce03b4a7434de /src
parentf641fca0652d62e312c6b2fe2f9f25d960a5c126 (diff)
downloadpowder-7e3c73f66f24924ab3e3e11f96c3bc02eb950260.zip
powder-7e3c73f66f24924ab3e3e11f96c3bc02eb950260.tar.gz
Fix graphics function crash
Diffstat (limited to 'src')
-rw-r--r--src/luaconsole.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/src/luaconsole.c b/src/luaconsole.c
index a6d60ad..b89e125 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;
}