The old code used getstarg() to get an argument with a different
prompt than snxtitem() uses, then passed the value to snxtitem()
unchecked. If the player aborts, getstarg() returns a null pointer,
and snxtitem() prompts again. Affected:
* load/lload plane/land third argument; load_plane_ship(),
load_land_ship(), load_plane_land(), load_land_land()
* bomb, drop, fly, paradrop, recon and sweep second argument;
get_planes()
* tend and ltend second and fourth argument; ltend(), tend(),
tend_land()
* mission second argument; mission()
Fix by making snxtitem() taking a prompt argument, null pointer
requests the old prompt.
Use that to simplify multifire() and torp(). Change the other callers
to pass NULL.
Change retreat condition prompt to point to help. Before, it listed
conditions rather cryptically, without mentioning how to get help.
Don't provide help when encountering a bad retreat condition
character.
Fail the command when encountering a bad retreat condition character.
Before, they were dropped.
Don't fail the command when the player asks for help at the condition
code prompt.
Retreat condition help failed to explain 'c'.
The old code recognized group retreat only when the first argument was
on the command line. Didn't make a difference, because it was only
used when there were at least two arguments on the command line.
The old code relied on rflags being represented as two's complement.
When given an empty retreat path, the old code deleted the retreat
path and set the retreat flags normally. The new code deletes both.
Neither is nice; it should perhaps keep the retreat path and only set
the flags.
other. Ensure headers in include/ can be included in any order
(except for econfig-spec.h, which is special). New header types.h to
help avoid inclusion cycles. Sort include directives. Remove some
superflous includes.
effect. Replace calls by struct assignment where possible. Replace
clear buffer, copy string to buffer by strncpy(). Use assignment to
clear when that's clearer. Replace overlapping copy through bounce
buffer by memmove(). Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.