From a62b15ccd2288978adcf7b5ae7dd85fdd9cff386 Mon Sep 17 00:00:00 2001 From: expwnent Date: Sat, 28 Jun 2014 03:06:19 -0400 Subject: [PATCH] Revert "Allowed dfhack.timeout tick events to be queued before a world is loaded." This reverts commit ecd75e9b3e1191eee485c596d4c630bb7ddb48d2. --- NEWS | 2 -- library/LuaTools.cpp | 6 ++++++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/NEWS b/NEWS index a491c5235..e240a26ab 100644 --- a/NEWS +++ b/NEWS @@ -1,8 +1,6 @@ DFHack future Internals: - LuaApi - support queuing dfhack.timeout events before a world is loaded. New scripts: add-syndrome.lua add a syndrome to a unit. many configurable options diff --git a/library/LuaTools.cpp b/library/LuaTools.cpp index b70a33b2a..392659bc8 100644 --- a/library/LuaTools.cpp +++ b/library/LuaTools.cpp @@ -1694,6 +1694,12 @@ int dfhack_timeout(lua_State *L) luaL_checktype(L, 3, LUA_TFUNCTION); lua_settop(L, 3); + if (mode > 0 && !Core::getInstance().isWorldLoaded()) + { + lua_pushnil(L); + return 1; + } + // Compute timeout value switch (mode) {