| 2070 | } |
| 2071 | |
| 2072 | void DFHack::Lua::Core::onUpdate(color_ostream &out) |
| 2073 | { |
| 2074 | auto State = DFHack::Core::getInstance().getLuaState(); |
| 2075 | using df::global::world; |
| 2076 | |
| 2077 | if (frame_timers.empty() && tick_timers.empty()) |
| 2078 | return; |
| 2079 | |
| 2080 | Lua::StackUnwinder frame(State); |
| 2081 | lua_rawgetp(State, LUA_REGISTRYINDEX, &DFHACK_TIMEOUTS_TOKEN); |
| 2082 | |
| 2083 | run_timers(out, State, frame_timers, frame[1], ++frame_idx); |
| 2084 | |
| 2085 | if (world) |
| 2086 | run_timers(out, State, tick_timers, frame[1], world->frame_counter); |
| 2087 | } |
| 2088 | |
| 2089 | static void Lua::Core::InitCoreContext(color_ostream &out) |
| 2090 | { |
nothing calls this directly
no test coverage detected