MCPcopy Create free account
hub / github.com/DFHack/dfhack / dfhack_event_call

Function dfhack_event_call

library/LuaTools.cpp:1686–1699  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1684}
1685
1686static 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
1701void DFHack::Lua::Event::Invoke(color_ostream &out, lua_State *state, void *key, int num_args)
1702{

Callers

nothing calls this directly

Calls 7

luaL_checktypeFunction · 0.85
luaL_checkstackFunction · 0.85
lua_gettopFunction · 0.85
lua_touserdataFunction · 0.85
lua_getuservalueFunction · 0.85
dfhack_event_invokeFunction · 0.85
on_invokedMethod · 0.80

Tested by

no test coverage detected