multifire() used shots to print either shell or shells. 4.2.3 removed
its initialization for land unit fire, and commit 22c6fd8b removed it
for ship fire. Fix by just printing shells always.
Improve the portability. The Windows version of "echo" does
not support single quotes as a quoting character and therefore
fails and prevents updates in the Windows nightly build.
The old code let each defender fire on each target separately. To
avoid charging ammo multiple times, it didn't update the defenders
after fire; it charged them in use_ammo() instead. Bugs: not updating
the defender lost any shells fetched by automatic resupply, and
use_ammo() always charged one shell for gun fire, which was wrong for
most ships and land units.
Rewrite to let each defender fire once, updating it normally. Reuse
the damage for the other targets. This also yields the proper
probability distribution for damage.
add_to_fired_queue() adds a defender at most once. It neglects to
free the defender flist nodes it doesn't add. Broken since option
MULTIFIRE appeared in Chainsaw.
Make deffld() reject fields whose selector has flag NSC_EXTRA set.
Since xundump() doesn't provides space for these, the bug could lead
to buffer overruns.
Make sure all members of unit empobj_storage share it.
Add matching timestamp member to struct comstr, struct empobj, struct
gamestr, struct lonstr, struct natstr, struct nwsstr, struct trdstr,
struct trtstr. The timestamp isn't yet set for these. To be fixed.
Move the timestamp member to the right place in struct lndstr, struct
loststr, struct realmstr, struct nukstr, struct plnstr, struct sctstr,
struct shpstr.
The common nation wipe code is not quite identical, and it doesn't
wipe the nation thoroughly enough. The new code does.
Changes to both commands:
* Wipe nat_update, nat_ann, nat_access, and nat_contact. Bug: should
set nat_ann to the number of announcements.
Changes to add command:
* Don't wipe for status active and god. Before, nat_relate and
nat_flags where wiped then.
Changes to newcap command:
* Wipe nat_hostaddr, nat_hostname, nat_userid, nat_dayno, nat_minused,
nat_reserve, nat_last_login, nat_last_logout, nat_newstim,
nat_annotim, nat_relate, nat_rejects, nat_flags.
empdump exports and imports game state as plain text. Limitations: it
currently can't export player bmaps, power report, telegrams,
announcements, message of the day, no-login message and log files.
Exported floating-point values may be inexact. Importing an exported
game state may not result in identical data files; besides the loss of
floating-point precision just mentioned, coordinates are normalized,
and characters beyond a string's terminating zero in a character array
are lost. Bug: importing resets timestamps to zero. It should set
them to the current time.
This is for the forthcoming empdump utility program. The xdump
command still does not support the human-readable dialect.
xundump has supported the human-readable dialect for a long time
(commit 4871a10a).
struct lndstr members lnd_spy, lnd_rad, lnd_ammo, lnd_fuelc,
lnd_fuelu, lnd_maxlight, lnd_maxlight are mere copies of struct
lchrstr members l_spy, l_rad, l_ammo, l_fuelc, l_fuelu, l_nxlight,
l_nland. Remove them.
Make land unit selectors spy, rmax, ammo, fuelc, fuelu, maxlight
virtual.
New lnd_att(), lnd_def(), lnd_vul(), lnd_spd(), lnd_vis(), lnd_frg(),
lnd_acc(), lnd_dam(), lnd_aaf() replace the struct lndstr members with
the same names.
Make land unit selectors att, def, vul, spd, vis, frg, acc, dam, aaf
virtual.
New pln_att(), pln_def(), pln_acc(), pln_range_max(), pln_load()
replace the struct plnstr members with the same names.
Make plane selectors att and def virtual.
Where ordinary selectors specify a value stored in some object,
virtual selectors specify a function to call to compute a value
associated with some object.
Use them to replace the special case xdump ver by new table
EF_VERSION.
Move configkeys[] to lib/common because nsc_init() needs it to
initialize empfile[EF_VERSION].cadef.