From 2569abcdec955c4b04e39e62b1e2fbd19901a825 Mon Sep 17 00:00:00 2001 From: PeridexisErrant Date: Wed, 13 May 2015 22:58:34 +1000 Subject: [PATCH] Fix variables na and announcement -> msg --- scripts/warn-starving.lua | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/scripts/warn-starving.lua b/scripts/warn-starving.lua index 18eb8fa85..d8dd2d4ee 100644 --- a/scripts/warn-starving.lua +++ b/scripts/warn-starving.lua @@ -43,22 +43,20 @@ local function checkVariable(var, limit, description, map, unit) end local function doCheck() - local announcement + local msg for i=#units-1, 0, -1 do local unit = units[i] local rraw = findRaceCaste(unit) if rraw and not unit.flags1.dead and not dfhack.units.isOpposedToLife(unit) then - local na = checkVariable(unit.counters2.hunger_timer, 75000, 'starving', starvingUnits, unit) - na = na or checkVariable(unit.counters2.thirst_timer, 50000, 'dehydrated', dehydratedUnits, unit) - na = na or checkVariable(unit.counters2.sleepiness_timer, 150000, 'very drowsy', sleepyUnits, unit) - if na then - announcement = newAnnouncement + msg = checkVariable(unit.counters2.hunger_timer, 75000, 'starving', starvingUnits, unit) + msg = msg or checkVariable(unit.counters2.thirst_timer, 50000, 'dehydrated', dehydratedUnits, unit) + msg = msg or checkVariable(unit.counters2.sleepiness_timer, 150000, 'very drowsy', sleepyUnits, unit) end end end - if announcement then + if msg then df.global.pause_state = true - dfhack.gui.showPopupAnnouncement(announcement, 7, true) + dfhack.gui.showPopupAnnouncement(msg, 7, true) end end