| 2014 | } |
| 2015 | |
| 2016 | static 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 | |
| 2032 | void DFHack::Lua::Core::onStateChange(color_ostream &out, int code) { |
| 2033 | auto State = DFHack::Core::getInstance().getLuaState(); |
no test coverage detected