Correct LuaRegEvent to use broker.
authorGuo Rui <firemeteor@Adam.(none)>
Mon, 27 Jul 2009 17:13:44 +0000 (28 01:13 +0800)
committerGuo Rui <firemeteor@Adam.(none)>
Mon, 27 Jul 2009 17:13:44 +0000 (28 01:13 +0800)
src/lua.c

index 09dc95e..0157cb4 100644 (file)
--- a/src/lua.c
+++ b/src/lua.c
@@ -1516,7 +1516,11 @@ LuaRegEvent(lua_State *L)
       if (!strcmp("screen", objname))
         objname = "global";
       else
-        obj = *(char **)lua_touserdata(L, 1);
+       {
+         obj = get_broker_obj((struct broker **)lua_touserdata(L, 1));
+         if (!obj)
+           return luaL_error(L, "Invalid object specified");
+       }
       idx++;
     }