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

Function run_timers

library/LuaTools.cpp:2050–2070  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2048}
2049
2050static void run_timers(color_ostream &out, lua_State *L,
2051 std::multimap<int,int> &timers, int table, int bound)
2052{
2053 while (!timers.empty() && timers.begin()->first <= bound)
2054 {
2055 int id = timers.begin()->second;
2056 timers.erase(timers.begin());
2057
2058 lua_rawgeti(L, table, id);
2059
2060 if (lua_isnil(L, -1))
2061 lua_pop(L, 1);
2062 else
2063 {
2064 lua_pushnil(L);
2065 lua_rawseti(L, table, id);
2066
2067 Lua::SafeCall(out, L, 0, 0);
2068 }
2069 }
2070}
2071
2072void DFHack::Lua::Core::onUpdate(color_ostream &out)
2073{

Callers 1

onUpdateMethod · 0.85

Calls 7

lua_rawgetiFunction · 0.85
lua_pushnilFunction · 0.85
lua_rawsetiFunction · 0.85
SafeCallFunction · 0.85
emptyMethod · 0.45
beginMethod · 0.45
eraseMethod · 0.45

Tested by

no test coverage detected