Commit graph

1865 commits

Author SHA1 Message Date
b8b243339f (retreat_ship1): Fix sector ownership test. Before, retreating ships
could enter sectors owned by whoever caused the retreat, but not own
sectors.  Reported by Ray Hyatt.  Closes #1346750.
2006-03-27 20:43:57 +00:00
d182f3dc1d (command): Simplify mapping of condarg to lower case. 2006-03-27 20:13:50 +00:00
fce8b1aa38 (lost): Simplify code for argument default value. 2006-03-27 19:53:05 +00:00
3aea505aa7 Cosmetics. 2006-03-27 19:50:38 +00:00
523936cfef (map, rout, sct, surv): Remove special case for sects argument `*',
snxtsct() handles it just fine.
2006-03-27 19:45:08 +00:00
f99bc9298a (map): Simplify slightly. 2006-03-27 19:24:44 +00:00
a1907851be (player_coms): test needs C_MOD flag, because it calls draw_map()
through map().
2006-03-27 19:19:58 +00:00
1ddb87d235 (tran_map): Set player->argp[0]. Required since bmap() was merged
into map() ca. 1995.  Fixes 'm' at test's move_ground() prompt.
Simplify clearing player->argp[2].  Don't clear beyond that.
2006-03-27 19:10:40 +00:00
18bbcb2c9e (tran_map): Set player->argp[0]. Required since bmap() was merged
into map() ca. 1995.  Clear player->argp[2].  Required since map
acquired its second argument in the early 90s.  Fixes 'm' at
transport's move_ground() prompt.
2006-03-27 19:00:42 +00:00
2ff3fe97a2 (unit_map): Don't use snxtsct(), it obeys conditionals. Use
snxtsct_area().  Callers march() and navi() clearly don't want it to
use conditionals.  navi() used to zap them (just removed).  march()
doesn't, which was a bug similar to #785447.  It's less clear for
caller map().  I'd argue that conditionals apply to map's argument,
the unit number, not to the map itself.  draw_map() zaps them anyway.
2006-03-27 18:45:20 +00:00
38f4026aee (unit_map): Simplify. 2006-03-27 18:42:18 +00:00
707e1aad72 (explore_map, nav_map, move_map, fly_map): Don't use snxtsct(), it
obeys conditionals.  Use snxtsct_dist().  Closes #785447.  Only march
and test were actually broken, the other uses zapped conditionals.
(move_map, fly_map, nav_map, navi): Don't zap conditionals.
2006-03-27 18:20:25 +00:00
62d95ff6d4 (bsanct): Use snxtitem_all() instead of snxtitem(). The latter uses
player->condarg, which lets players keep sanctuaries.  Broken in the
early 90s.
2006-03-26 19:21:13 +00:00
404fe4ad86 (retreat_ship1, retreat_land1): Use snxtitem_group() instead of
snxtitem() for RET_GROUP.  The latter uses player->condarg, which lets
crafty attackers suppress retreat.
2006-03-26 19:09:06 +00:00
cc29b27a67 (conditions): Give sentinel a legible desc[], just in case.
(findcondition): Oops on hitting the sentinel.

(retreat_ship1, retreat_land1): Don't bother to map code to lower
case, it doesn't occur.
2006-03-26 19:02:28 +00:00
021a91a779 The previous revision is wrong, back it out. 2006-03-26 17:36:27 +00:00
82a3c0d0f5 The revision before the previous one is partially wrong, back out the
bad parts.
2006-03-26 17:34:58 +00:00
e438227011 The revision before the previous one is wrong, back it out. 2006-03-26 17:33:46 +00:00
053847beac (file_sct_init, fl_sct_init): Fix parameter type from s_char * to
struct sctstr *.  Callers changed not to cast.
2006-03-26 15:07:32 +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
d9b6937634 (sd): Supply missing parenthesis for a cast from double to int. The
cast is only there to express intent, it doesn't change the meaning of
the code.
2006-03-26 14:03:50 +00:00
2f08b52cef (shut): Fix misuse of logerror(): passed formatted string instead of
format string and arguments.  Correctness depends on formatted string
not containing '%', which is the case.
2006-03-26 13:59:47 +00:00
29faf70fa7 (show_sail): Fix misuse of pr(): passed formatted string instead of
format string and arguments.  Correctness depends on paths not
containing '%', which is correct, but not as robust as it could be.
2006-03-26 13:57:34 +00:00
b49bfd7814 (unit_interdict, knockdown): Simplify. No functional change. 2006-03-26 13:55:29 +00:00
4c6fb12377 Code formatting. No functional changes. 2006-03-26 13:52:23 +00:00
b0a5d11a3f (show_nuke_capab, show_ship_capab, show_plane_capab, show_land_capab)
(prxy, border, ac_encounter, look, budg): Fix misuse of pr() and PR():
passed formatted string instead of format string and arguments.
Correctness depends on argument values and tables not containing '%',
which is correct, but fragile.
2006-03-26 13:41:46 +00:00
65168f0d93 (comm_bomb, ship_bomb, land_bomb, pinflak_planedamage): Fix dangerous
misuse of pr(), PR() and mpr(): passed formatted string instead of
format string and arguments.  Crash bug if formatted string contains
'%'.  Players can put that in ship names...
2006-03-26 13:34:35 +00:00
ade364fa1d (prunits, prplanes): Simplify, compute relation string instead of
format.

(prplanes): Fix dangerous misuse of pr(): passed formatted string
instead of format string and arguments.  Crash bug if formatted string
contains '%'.  Players can put that in country names...
2006-03-26 12:54:52 +00:00
7b4a164d0a (prod): Simplify printing of materials used. Don't assume amount fits
into eight characters and item mnemo can't be '%'.
2006-03-26 12:37:22 +00:00
aee94ca077 (head_describe): Print the headline instead of returning the format
string.  This simplifies format string checking.
2006-03-26 12:08:35 +00:00
197d8cd2ca (prthresh): Remove format string parameter. Callers don't really need
that flexibility, and it makes format checking harder.
2006-03-26 10:21:57 +00:00
8cd3845b08 Remove useless multiplications with sizeof(char) and sizeof(s_char).
Replace by literal 1 in other contexts.
2006-03-26 10:16:08 +00:00
8ca2468706 (gift): Fix parameter types: natid instead of int, void * for generic
pointer, char * for string.
2006-03-26 08:18:34 +00:00
a6843eeba6 (gift, load_comm_ship, load_comm_land): Fix dangerous misuse of wu():
passed formatted string instead of format string and arguments.  Crash
bug if formatted string contains '%'.  Players can put that in ship
names...
2006-03-26 08:15:27 +00:00
0d0a305bf3 Remove silly superflous parenthesis. 2006-03-26 07:46:49 +00:00
beae3ea770 (getele): Zero-terminate empty telegrams. Returned telegram was
broken in rev. 1.9.  ~p never worked.
2006-03-25 20:11:55 +00:00
5122f25f6c Fix land unit speed. Reported by Pat Loney. Fix spelling. 2006-03-25 19:59:21 +00:00
2e32b87695 (buil): Simplify the loop for building multiple units. Unit type
argument "" no longer makes it prompt for the unit type on every
iteration.
2006-03-25 19:16:35 +00:00
90bddc6541 (buil): Return RET_FAIL on insufficient tech for bridge instead of
literal 2 (which is RET_SYN).  Return RET_SYN on incorrect first
argument.
2006-03-25 18:56:34 +00:00
2a3da4916e (build_ship, build_land, build_plane): Compute cost in floating-point.
It's better to round just once, when subtracting player->dolcost from
nat_money.
2006-03-25 16:36:45 +00:00
2625dc4b8f (build_can_afford): New.
(build_ship, build_land, build_bridge, build_nuke, build_plane)
(build_tower): Use it.  This changes some messages.  Fixes ancient
bridge building race condition: while prompting for direction, another
build could clobber cash.
(cash): Remove.
2006-03-25 16:21:48 +00:00
38f3f7ea49 (trade_check_item_ok): New.
(trade_check_ok): Use it and simplify.

(set): Use new trade_check_item_ok().  The code replaced by it didn't
work (abusable bug).
2006-03-25 15:26:29 +00:00
79714720cc (ontradingblock, trdswitchown): Second parameter is a generic pointer,
change it from int * to void *.  Callers changed not to cast to int *.
2006-03-25 15:11:17 +00:00
05f64e8c3f (genstr): Redundant. Replace by struct genitem. 2006-03-25 15:03:32 +00:00
94d0c81e55 Define feature test macro required for PTHREAD_STACK_MIN on some
systems, e.g. Solaris.
2006-03-25 10:15:13 +00:00
9055031b7f Fix the previous revision. 2006-03-25 09:08:58 +00:00
ba11aaaa36 (empth_create): LWP yields, and it's the reference implementation.
Document and fix the others.
2006-03-25 07:49:37 +00:00
8054aafb9a (u_char, u_short, u_int): BSDisms. Figuring out whether sys/types.h
defines them would be possible, but isn't worth the trouble.  Replace
by unabbreviated types.
2006-03-25 07:05:34 +00:00
21bf6b41d4 Use NULL instead of (FOO *)0, it's easier to read. 2006-03-23 20:48:49 +00:00
3252f8a907 (dirchar, neighsects, login_coms, lookup_list, g_distptrs, level_easy)
(level_log, levelnames): Internal linkage.
2006-03-23 20:32:29 +00:00