Commit graph

36 commits

Author SHA1 Message Date
c0ed527311 Consistently use int for file type parameters and locals 2009-12-29 17:23:22 +01:00
35ef345ecb Update copyright notice 2009-02-08 09:33:18 +01:00
d702068457 Fix trailing whitespace 2008-09-17 21:31:40 -04:00
3cc8de8aef Fix extra prompt after abort due to misuse of snxtitem()
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.
2008-07-26 21:36:37 -04:00
bb5dfd803b Clean up and improve retreat condition handling
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'.
2008-07-12 10:41:44 -04:00
700089dd42 Clean up unified unit loop in retreat()
Factor common code out of the type conditional.  Widens the "as flt?"
column to match the "as army?" column.
2008-07-11 07:19:29 -04:00
6b311f39da Unify retreat and lretreat code
New retreat(), call from retr() and lretr().  No functional changes.
Needs cleanup.
2008-07-11 07:19:29 -04:00
44e2ef468f Make retr() and lretr() simpler and more robust
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.
2008-07-11 07:18:59 -04:00
db02dda32f Update copyright notice 2008-01-19 10:15:37 +01:00
63bdc89835 Update copyright notice. 2007-01-09 19:09:31 +00:00
e42053d928 Break inclusion cycle: prototypes.h and commands.h included each
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.
2006-07-10 06:37:23 +00:00
1b94ddedc3 Change encoding of `not in any group' from space to 0, because that's
friendlier in conditionals:
(army, build_ship, build_land, build_plane, doship, doplane, dounit)
(flee, check_trade, wing, snxtitem_group, takeover_ship)
(takeover_land): Assign 0 instead of space.
(carg, lcarg, pr_ship, pr_plane, pr_land, ldump, land, pdump, plan)
(retr, lretr, sdump, shi, lnd_list, shp_list, ask_olist, att_prompt)
(ask_move_in): Update printing of group.

(takeover_plane): Failed to clear wing.
2006-05-27 13:44:18 +00:00
f59fd6e8eb (retr, lretr): Readability fixes. 2006-04-30 12:52:30 +00:00
e28851b8e9 Normalize unsigned int to just unsigned. 2006-04-30 12:26:07 +00:00
a988b907fc s_char purge directed by compiler warnings. 2006-04-29 06:41:45 +00:00
5d6e8c0685 (retr, lretr, doship, dounit): Zero-terminate retreat paths. The last
character in the array must be zero already.  Closes #1225708.
2006-03-26 14:42:27 +00:00
21bf6b41d4 Use NULL instead of (FOO *)0, it's easier to read. 2006-03-23 20:48:49 +00:00
4515b84c59 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.
2006-01-21 19:48:41 +00:00
0fe877e1cd Remove useless width from printf conversion %c. 2006-01-14 20:06:29 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
24a07cd249 player.h rev. 1.9 changed struct player member argp to char *. The
changeset failed to adapt some s_char * operands.  Fix.
2005-12-28 22:21:42 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
8e16ae9e43 Remove superflous #include "options.h". 2005-12-23 11:04:56 +00:00
190cbaadf2 (carg, lcarg, fort, land, ldump, lsta, orde, payo, retr, lretr)
(cmd_sail_ship, cmd_unsail_ship, show_sail, sdump, shi, sstat, work):
Remove inappropriate ship/land sanity checks; should be done
elsewhere.
2005-11-06 20:54:59 +00:00
380b063f9c Remove some redundant parenthesis; no functional change. 2005-07-23 19:48:35 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
929b3ba412 (retr): Use RET_GROUP instead of literal 1. No functional changes. 2005-02-23 15:27:19 +00:00
Marc Olzheim
c6ef918f3a Cleanup #includes of (mostly a long time) unused header files.
No functional changes.
2004-12-13 16:47:13 +00:00
Marc Olzheim
e9a040adb9 Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes. 2004-10-12 20:08:51 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
d0cf6a0a9b Clean up switch cases: proper fall through comments, no break after
return.
2004-03-01 14:03:29 +00:00
46da1aec7a deity.h is redundant, remove it. 2004-02-20 20:34:43 +00:00
4ae9c417b3 (bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
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.
2004-01-08 17:54:28 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00