DFHack / dfhack

Memory hacking library for Dwarf Fortress and a set of tools that use it
Other
1.86k stars 468 forks source link

deathcause throwing error on animal corpses and body parts #1726

Closed qeveren closed 3 years ago

qeveren commented 3 years ago

Any time I use deathcause on an animal corpse or body part it returns the following error:

E: NoMethodError: undefined method `killer_tg' for #<DFHack::Incident:0x0002f6a5907678>
 hack/scripts/deathcause.rb:31:in `display_death_unit'
 hack/scripts/deathcause.rb:62:in `<top (required)>'
 eval:2:in `load'
 eval:2:in `block in <main>'
 eval:2:in `catch'
 eval:2:in `<main>'

Each error differs only in the Incident ID. The error also seems to occur for any unit (animal or sentient) killed with the exterminate command.

quietust commented 3 years ago

Commit dfhack/df-structures@55d2da77374bab9f751f1e15d705cc3d174c375a renamed the killer field to criminal, so this script can't find it anymore.

Try editing deathcause.rb and replacing "killer_tg" with "criminal_tg".

qeveren commented 3 years ago

Try editing deathcause.rb and replacing "killer_tg" with "criminal_tg".

Yup, that works!

lethosor commented 3 years ago

All right, I'll go ahead with that fix. Thanks for checking!