Skip to content

Commit cf4af78

Browse files
Update deathcause.lua
final fixes
1 parent 2fb14b6 commit cf4af78

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

deathcause.lua

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
-- show death cause of a creature
2+
--@ module = true
23

34
local DEATH_TYPES = reqscript('gui/unit-info-viewer').DEATH_TYPES
45

@@ -29,7 +30,7 @@ function displayDeathUnit(unit)
2930
str = str .. dfhack.units.getReadableName(unit)
3031

3132
if not dfhack.units.isDead(unit) then
32-
return(str .. " is not dead yet!")
33+
return str .. " is not dead yet!"
3334
end
3435

3536
str = str .. (" %s"):format(getDeathStringFromCause(unit.counters.death_cause))
@@ -49,7 +50,7 @@ function displayDeathUnit(unit)
4950
end
5051
end
5152

52-
return(str .. '.')
53+
return str .. '.'
5354
end
5455

5556
-- returns the item description if the item still exists; otherwise
@@ -86,7 +87,7 @@ function displayDeathEventHistFigUnit(histfig_unit, event)
8687
end
8788
end
8889

89-
return( str .. '.')
90+
return str .. '.'
9091
end
9192

9293
-- Returns the death event for the given histfig or nil if not found
@@ -108,7 +109,7 @@ function displayDeathHistFig(histfig)
108109
end
109110

110111
if not dfhack.units.isDead(histfig_unit) then
111-
return(("%s is not dead yet!"):format(dfhack.units.getReadableName(histfig_unit)))
112+
return ("%s is not dead yet!"):format(dfhack.units.getReadableName(histfig_unit))
112113
else
113114
local death_event = getDeathEventForHistFig(histfig.id)
114115
return displayDeathEventHistFigUnit(histfig_unit, death_event)
@@ -146,6 +147,10 @@ local function get_target()
146147
return selected_item.hist_figure_id, df.unit.find(selected_item.unit_id)
147148
end
148149

150+
if dfhack_flags.module then
151+
return
152+
end
153+
149154
local hist_figure_id, selected_unit = get_target()
150155

151156
if not hist_figure_id then

0 commit comments

Comments
 (0)