DFHack / df-structures

Dwarf Fortress data structure descriptions
https://github.com/DFHack/dfhack
116 stars 81 forks source link

Comment refers to inexistent object #305

Open juanmeleiro opened 5 years ago

juanmeleiro commented 5 years ago

https://github.com/DFHack/df-structures/blob/72488ba15a13e46f82aaf32bc776b51b92353271/df.units.xml#L414

The comment “Used in unit.relations” refers to inexistent object unit.relations. Did it ever exist?

Tested it with

for i, u in pairs(df.global.world.units.all) do
  for k, v in pairs(u) do
    if k == 'relations' then
      print(i)
    end
  end
end
lethosor commented 5 years ago

It used to exist. It got moved out into the main unit structure at some point. Maybe this comment should mention unit.relationship_ids, but I don't know off the top of my head. In any case, all units have the exact same fields, since unit doesn't have any subclasses, so you only really have to check the first unit in the code you posted.