Fix variables na and announcement -> msg

develop
PeridexisErrant 2015-05-13 22:58:34 +10:00
parent 3583004c6d
commit 2569abcdec
1 changed files with 6 additions and 8 deletions

@ -43,22 +43,20 @@ local function checkVariable(var, limit, description, map, unit)
end end
local function doCheck() local function doCheck()
local announcement local msg
for i=#units-1, 0, -1 do for i=#units-1, 0, -1 do
local unit = units[i] local unit = units[i]
local rraw = findRaceCaste(unit) local rraw = findRaceCaste(unit)
if rraw and not unit.flags1.dead and not dfhack.units.isOpposedToLife(unit) then 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) msg = checkVariable(unit.counters2.hunger_timer, 75000, 'starving', starvingUnits, unit)
na = na or checkVariable(unit.counters2.thirst_timer, 50000, 'dehydrated', dehydratedUnits, unit) msg = msg or checkVariable(unit.counters2.thirst_timer, 50000, 'dehydrated', dehydratedUnits, unit)
na = na or checkVariable(unit.counters2.sleepiness_timer, 150000, 'very drowsy', sleepyUnits, unit) msg = msg or checkVariable(unit.counters2.sleepiness_timer, 150000, 'very drowsy', sleepyUnits, unit)
if na then
announcement = newAnnouncement
end end
end end
end end
if announcement then if msg then
df.global.pause_state = true df.global.pause_state = true
dfhack.gui.showPopupAnnouncement(announcement, 7, true) dfhack.gui.showPopupAnnouncement(msg, 7, true)
end end
end end