| 1684 | } |
| 1685 | |
| 1686 | static int dfhack_event_call(lua_State *state) |
| 1687 | { |
| 1688 | luaL_checktype(state, 1, LUA_TUSERDATA); |
| 1689 | luaL_checkstack(state, lua_gettop(state)+2, "stack overflow in event dispatch"); |
| 1690 | |
| 1691 | auto obj = (EventObject *)lua_touserdata(state, 1); |
| 1692 | if (obj->owner) |
| 1693 | obj->owner->on_invoked(state, lua_gettop(state)-1, false); |
| 1694 | |
| 1695 | lua_getuservalue(state, 1); |
| 1696 | lua_replace(state, 1); |
| 1697 | dfhack_event_invoke(state, 0, false); |
| 1698 | return 0; |
| 1699 | } |
| 1700 | |
| 1701 | void DFHack::Lua::Event::Invoke(color_ostream &out, lua_State *state, void *key, int num_args) |
| 1702 | { |
nothing calls this directly
no test coverage detected