diff options
-rw-r--r-- | html/en/history.html | 6 | ||||
-rw-r--r-- | src/lua5/cdlua5.c | 5 |
2 files changed, 9 insertions, 2 deletions
diff --git a/html/en/history.html b/html/en/history.html index e546520..16fab15 100644 --- a/html/en/history.html +++ b/html/en/history.html @@ -10,12 +10,14 @@ <body> <h1>History of Changes</h1> -<h3>CVS (22/Oct/2008)</h3> +<h3>CVS (04/Nov/2008)</h3> <ul> <li><span style="color: #FF0000">Fixed:</span> CDLua binding functions canvas:foreground, canvas:setforeground, canvas:background and canvas:setbackground. Color was being checked from the wrong position in the - stack. Reported and invalid color when being used.</li> + stack. They were reporting and invalid color when being used.</li> + <li><span style="color: #FF0000">Fixed:</span> CDLua binding functions + canvas:foreground and canvas:background when using cd.QUERY are value. </li> </ul> <h3>Version 5.1 (14/Oct/2008)</h3> <ul> 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); } |