summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
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);
}