Skip to content

Commit 7b90330

Browse files
committed
Identified slaughter. Stopped item override
1 parent 82e6ffa commit 7b90330

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

deathcause.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ def display_death_unit(u)
3030
death_info = u.counters.death_tg
3131
killer = death_info.killer_tg if death_info
3232

33-
str << " died"
33+
str << " died" if !u.flags2.slaughter
34+
str << " was slaughtered" if u.flags2.slaughter
35+
3436
str << " in year #{death_info.event_year}" if death_info
3537
str << " (cause: #{u.counters.death_cause.to_s.downcase})," if u.counters.death_cause != -1
3638
str << " killed by the #{killer.race_tg.name[0]} #{killer.name}" if killer
@@ -42,7 +44,7 @@ def display_death_unit(u)
4244
item = df.item_find(:selected)
4345
unit = df.unit_find(:selected)
4446

45-
if !item or !item.kind_of?(DFHack::ItemBodyComponent)
47+
if !unit and (!item or !item.kind_of?(DFHack::ItemBodyComponent))
4648
item = df.world.items.other[:ANY_CORPSE].find { |i| df.at_cursor?(i) }
4749
end
4850

0 commit comments

Comments
 (0)