(show_nuke_capab, vers, xdvisible, build.t, Options.t):
Remove opt_DRNUKE and replace with the following check
drnuke_const > MIN_DRNUKE_CONST.
Set MIN_DRNUKE_CONST to 0.001 to prevent issues with tiny values.
Change the default drnuke_const to 0.0 because in the stock game
opt_DRNUKE was disabled.
(ellipsis): New.
(xuheader1): Initialize it. Compute nflds. Allow repetition of index
field in continued tables.
(xundump): Don't set nflds.
(xufldname, defellipsis): Accept ... and call new defellipsis().
(xufldname, chkflds): Update and elaborate check for missing fields,
move it to new chkflds(). Require repetition of index field in
continued tables.
(xundump2): New, factored out of xundump(). Parse continued tables.
(xundump1, setnum, setstr, getobj, cur_id): Delay table lookup until
first field is about to be assigned.
(xundump1): Record largest ID, because it's no longer given by final
value of row.
(xuheader1, xundump1, xundump): Move initialization of cur_type to
xundump().
selectors. That's wrong for EF_SECTOR_CHR and EF_PRODUCT. Don't
allow table shrinking just because it has no NSC_CONST selectors.
That's wrong for EF_NEWS_CHR. Allow it for game state and unit
characteristics.
(has_const): Unused, remove.
still be in order), support abbreviated field names:
(nxt_sel, nxt_idx, nxtfld, ca4fld): Remove.
(nflds, fldca, fldidx, caflds, getfld): New.
(xundump): Initialize and finalize them.
(xundump1): New, factored out of xundump().
(deffld): Match names, record field order in fldca[], fldidx[] for
getfld(). Use caflds[] to detect duplicates.
(xufldname): Catch negative index. Used to pass it to deffld(), which
now interprets it as no index.
(setnum, setstr, setsym, mtsymset, add2symset): Use getfld().
(xufld): Improve error message.
(setstr): Fix for NULL strings.
(xuheader): Catch null ef_cadef().
(xuheader): Don't oops when an unexpected table can't be undumped.
leaks memory; rework it:
(deffld): New; semantic action for field headers.
(xufldname): Use it instead of storing a value for xucolumnheader().
(xucolumnheader): Remove, use xuflds() directly instead.
(setnum, setstr, setsym): New; semantic actions for field values.
(xufld): Use it instead of storing a value for xuloadrow().
(xuloadrow): Remove. Was incomplete.
(xufldname, xufld, xuflds): Remove parameter values. Callers
changed.
(cur_type, cur_obj, nxt_sel, nxt_idx, nxtfld, ca4fld, getsymtab): New
helpers.
(xundump): Initialize them.
(enum_value, value, freeflds, xunsymbol): Remove.
(mtsymset, add2symset): New.
(xufld): Use them to build a symbol set along the parse.
(xufldname, xufld, xuheader, xutrailer, xundump): Increment lineno
when and only when a linefeed is consumed, to make sure it is correct.
Move some semantic checks so that errors get reported for the correct
line.
(xundump): Use compare filenames as pointers, not strings, when
checking whether to reset lineno.
(xundump): Keep empfile[type] consistent during parse, to make
ef_ptr() usable.
(xundump): Don't call ep->init() on sentinels.
(xuinitrow): Unused, remove.