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

Function cancel_timers

library/LuaTools.cpp:2016–2030  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2014}
2015
2016static void cancel_timers(std::multimap<int,int> &timers)
2017{
2018 auto State = DFHack::Core::getInstance().getLuaState();
2019
2020 Lua::StackUnwinder frame(State);
2021 lua_rawgetp(State, LUA_REGISTRYINDEX, &DFHACK_TIMEOUTS_TOKEN);
2022
2023 for (auto it = timers.begin(); it != timers.end(); ++it)
2024 {
2025 lua_pushnil(State);
2026 lua_rawseti(State, frame[1], it->second);
2027 }
2028
2029 timers.clear();
2030}
2031
2032void DFHack::Lua::Core::onStateChange(color_ostream &out, int code) {
2033 auto State = DFHack::Core::getInstance().getLuaState();

Callers 1

onStateChangeMethod · 0.85

Calls 6

lua_rawgetpFunction · 0.85
lua_pushnilFunction · 0.85
lua_rawsetiFunction · 0.85
beginMethod · 0.45
endMethod · 0.45
clearMethod · 0.45

Tested by

no test coverage detected