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

Method onUpdate

library/LuaTools.cpp:2072–2087  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2070}
2071
2072void 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
2089static void Lua::Core::InitCoreContext(color_ostream &out)
2090{

Callers

nothing calls this directly

Calls 3

lua_rawgetpFunction · 0.85
run_timersFunction · 0.85
emptyMethod · 0.45

Tested by

no test coverage detected