Accept fields out of order in human-readable syntax (indexes must
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.
The separation between parsing and semantic actions is awkward and
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.
(xufldname, xufld): New, factored out of xuflds and specialized for
headers and for body lines, respectively.
(xflds): Call them through new parameter parse. Callers changed.
(realm_ca): Remove selector uid. It's not useful for players, and not
needed for xdump, because it doesn't occur as ca_table.
(lost_ca): Remove selector uid. Reasons as for realm_ca. The value
is incorrect in unused records, which is semantically tolerable, but
needlessly complicated to check in ef_verify.c.
(news_ca): Remove selector uid. Reasons as for realm_ca, plus the
value is incorrect, because nws_uid is not used.
When sources.mk is needed to find directories, don't test whether it's
there, just use it. If it's not there, things will fail down the
road. Better to fail early.
Ron Koenderink [Sun, 5 Feb 2006 17:37:58 +0000 (17:37 +0000)]
(vers): Add collateral damage matrix to version report.
Add unit_damage and collateral_dam to the collateral damage matrix.
Move people_damage into matrix.
Ron Koenderink [Sun, 5 Feb 2006 15:52:26 +0000 (15:52 +0000)]
(vers): Add the following the configuration values to the version report:
torpedo_damage, flakscale, people_damage, assault_penalty,
decay_per_etu, fallout_spread, fuel_mult, max_btus and max_idle.
Ron Koenderink [Thu, 2 Feb 2006 13:20:14 +0000 (13:20 +0000)]
(vers): Add the following econfig values to version report:
MARK_DELAY, TRADE_DELAY, mission_mob_cost ,
money_ship, money_plane, money_land,
fort_max_interdiction_range, ship_max_interdiction_range,
land_max_interdiction_range, combat_mob and
sect_mob_neg_factor.
Ron Koenderink [Mon, 30 Jan 2006 22:23:43 +0000 (22:23 +0000)]
Properly parse and validate column headers:
(enum_value, value, xuflds, freeflds): Parse additional syntax:
numeric and symbolic index.
(xucolumnheader): Use it to parse column header line. Check names
and indexes match meta-data. Symbolic indexes not yet implemented.
(xuloadrow): Reject the additional syntax.
Ron Koenderink [Sun, 29 Jan 2006 13:56:35 +0000 (13:56 +0000)]
(ac_dog): Do not use 'ap' as a pointer to get the owner
for the call to ac_planedamage() use att_own instead.
'ap' may have been already freed in the previous call
to ac_planedamage(). This can create an invalid
news item and crash the server.
(vers): Don't report KSU distribution (1.04 in all known versions),
Chainsaw version (4.00 since Empire 2, ca. 1995) and Wolfpack version
(used to be the version number after the first dot).
(KSU_DIST, CHAINSAW_DIST, WOLFPACK_DIST): Unused, remove.
(version): New.
(EMP_VERS_MAJOR, EMP_VERS_MINOR, EMP_VERS_PATCH): Remove. Users
changed to use version[] instead. version[] is slightly easier to
initialize from configure.ac.
(check-version): No longer needed, remove.
Ron Koenderink [Sat, 21 Jan 2006 20:56:50 +0000 (20:56 +0000)]
(fuel, load, shp_check_nav, retreat_ship1, shp_nav_one_sector)
(shp_check_nav, sail_nav_fleet, bigcity_dchr[], sector_navigation[])
(d_navigation): Add a NEW d_navigation enum NAV_CANAL to
indicate that a sector has canal capability. Add canal determination
logic to shp_check_nav(). Update sector_navigation[] with new
canal navigation enum. Use shp_check_nav() to determine the
sector can be navigated.
Rewrite top-level README for new build process. Merge information
from LEGAL, remove that file. References to it were already removed
in the previous change set. Remove obsolete doc/compiling and
doc/disk_space.
COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is. Update all
the references to these files.
Ron Koenderink [Sat, 21 Jan 2006 00:30:17 +0000 (00:30 +0000)]
(shp_nav): Skip ships that are landlocked.
The shp_mess() frees the ship record but shp_nav() continues
processing the ship record causing a corruption of the
memory poll which results in a server crash.
Ron Koenderink [Tue, 17 Jan 2006 13:11:24 +0000 (13:11 +0000)]
(check_nav, shp_check_nav, sail_nav_fleet, retreat_ship1):
Make shp_check_nav() public.
Remove check_nav(), replace with shp_check_nav().
No functional change as check_nav() and shp_check_nav() are
identical.