From 9ac9ff15a24899dae0de9f36dd8135a1974fad09 Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Tue, 24 Nov 2015 16:59:15 +0930 Subject: [PATCH] Ensure event_loop will be disabled --- scripts/modtools/extra-gamelog.lua | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/modtools/extra-gamelog.lua b/scripts/modtools/extra-gamelog.lua index c3652c834..47f39b574 100644 --- a/scripts/modtools/extra-gamelog.lua +++ b/scripts/modtools/extra-gamelog.lua @@ -175,14 +175,17 @@ local function event_loop() log_nobles() log_siege() log_buildings() - dfhack.timeout(50, 'ticks', event_loop) + if extra_gamelog_enabled then dfhack.timeout(50, 'ticks', event_loop) end end +extra_gamelog_enabled = false local args = {...} if args[1] == 'disable' then dfhack.onStateChange[_ENV] = nil + extra_gamelog_enabled = false elseif args[1] == 'enable' then dfhack.onStateChange[_ENV] = log_on_load + extra_gamelog_enabled = true event_loop() else print(help)