@@ -19,19 +19,6 @@ if args.help then
19
19
return
20
20
end
21
21
22
- function isCitizen (unit )
23
- -- required as dfhack.units.isCitizen() returns false for dead units
24
- local hf = df .historical_figure .find (unit .hist_figure_id )
25
- if not hf then
26
- return false
27
- end
28
- for _ ,link in ipairs (hf .entity_links ) do
29
- if link .entity_id == df .global .plotinfo .group_id and df .histfig_entity_link_type [link :getType ()] == ' MEMBER' then
30
- return true
31
- end
32
- end
33
- end
34
-
35
22
function addResurrectionEvent (histFigID )
36
23
local event = df .history_event_hist_figure_revivedst :new ()
37
24
event .histfig = histFigID
@@ -48,7 +35,7 @@ function heal(unit, resurrect, keep_corpse)
48
35
end
49
36
if resurrect then
50
37
if unit .flags2 .killed and not unit .flags3 .scuttle then -- scuttle appears to be applicable to just wagons, which probably shouldn't be resurrected
51
- -- print(" Resurrecting..." )
38
+ print (( ' Resurrecting %s ' ): format ( dfhack . units . getReadableName ( unit )) )
52
39
unit .flags1 .inactive = false
53
40
unit .flags2 .slaughter = false
54
41
unit .flags2 .killed = false
@@ -250,7 +237,7 @@ if args.all then
250
237
elseif args .all_citizens then
251
238
-- can't use dfhack.units.getCitizens since we want dead ones too
252
239
for _ ,unit in ipairs (df .global .world .units .active ) do
253
- if dfhack .units .isCitizen (unit ) or dfhack .units .isResident (unit ) then
240
+ if dfhack .units .isCitizen (unit , true ) or dfhack .units .isResident (unit ) then
254
241
heal (unit ,args .r ,args .keep_corpse )
255
242
end
256
243
end
0 commit comments