Closed lethosor closed 5 months ago
This looks good to me in general, but I notice that some of the fields are being initialized to -1 and I don't understand why this happens. Why is, for example, hist_figure_id
being initialized to -1 in job_spec_data
. While I agree that this is correct (or at least reasonable, I haven't checked to see what DF's own constructor does in this situation and is in fact what DF does), I don't understand what in either codegen or the XML is causing that to happen.
Why is, for example,
hist_figure_id
being initialized to -1 injob_spec_data
That's handled here in render_field_init
: https://github.com/DFHack/df-structures/blob/833a1fd45905cd6c57be037ea940189cd19b339c/StructFields.pm#L423-L428
This allows
job_spec_data
fields embedded in other types to be initialized to -1 as expectedFull diff of codegen output - extra eyes on this appreciated, as I haven't verified that all of the changes are reasonable: