summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorscuri <scuri>2008-11-04 23:21:50 +0000
committerscuri <scuri>2008-11-04 23:21:50 +0000
commit65a02bfa93a714b1362989f90137d6604bc7bb3a (patch)
treef526cc2389d16b02a21a59bf3f32e605cee53148 /src
parent5b337b3c5aa0560b687be1661b857da532a9fbfc (diff)
*** empty log message ***
Diffstat (limited to 'src')
-rw-r--r--src/lua5/cdlua5.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/lua5/cdlua5.c b/src/lua5/cdlua5.c
index 9ee3d4e..db22422 100644
--- a/src/lua5/cdlua5.c
+++ b/src/lua5/cdlua5.c
@@ -285,7 +285,12 @@ void cdlua_pushchannel(lua_State* L, unsigned char* channel, int size)
long cdlua_checkcolor(lua_State* L, int param)
{
if (!lua_islightuserdata(L, param))
+ {
+ if (lua_isnumber(L, param) && (lua_tointeger(L, param) == CD_QUERY))
+ return CD_QUERY;
+
luaL_argerror(L, param, "invalid color, must be a light user data");
+ }
return (long int)lua_touserdata(L, param);
}