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

Method onStateChange

library/LuaTools.cpp:2032–2048  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2030}
2031
2032void DFHack::Lua::Core::onStateChange(color_ostream &out, int code) {
2033 auto State = DFHack::Core::getInstance().getLuaState();
2034 if (!State) return;
2035
2036 switch (code)
2037 {
2038 case SC_MAP_UNLOADED:
2039 case SC_WORLD_UNLOADED:
2040 cancel_timers(tick_timers);
2041 break;
2042
2043 default:;
2044 }
2045
2046 Lua::Push(State, code);
2047 Lua::Event::Invoke(out, State, (void*)onStateChange, 1);
2048}
2049
2050static void run_timers(color_ostream &out, lua_State *L,
2051 std::multimap<int,int> &timers, int table, int bound)

Callers

nothing calls this directly

Calls 2

cancel_timersFunction · 0.85
PushFunction · 0.85

Tested by

no test coverage detected