| 2030 | } |
| 2031 | |
| 2032 | void 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 | |
| 2050 | static void run_timers(color_ostream &out, lua_State *L, |
| 2051 | std::multimap<int,int> &timers, int table, int bound) |
nothing calls this directly
no test coverage detected