(guerrilla): Round security unit raid value below one to zero instead
of one. Before, an empty, inefficient unit could be used to kill one
rebel per update.
(guerrilla): Security units' raid was broken in 4.0.0: the number of
che killed was 100 times too small, thus zero for all practical cases.
4.2.7 attempted to fix it, but left it broken for efficiency < 100.
It also increased deadliness of 100% units by a factor of 2.5.
Restore pre-4.0.0 behavior.
(snxtsct): Iteration order for `*' disclosed the real origin. Fix.
Mapping commands used to work around this bug, until map.c rev. 1.18,
rout.c 1.18, sct.c 1.17, surv.c 1.18 removed the work-around and thus
exposed the bug.
(sail): There is no qsail command, remove test for it. Test the
second argument only when the command is sail. Before, `unsail 42 q'
showed the sailing path instead of clearing it.
(bestownedpath): Return NULL on long path instead of "?". Terminate
returned path with 'h'. This makes BestShipPath() and BestAirPath()
more similar to BestLandPath(). Simplify callers.
(owned_and_navigable): Rework rev. 1.18: do check the real sector, but
only if it's owned or allied. Check it before the bmap, and do it
just like shp_check_nav() does (should use common code).
(getpath): Supply the missing code for P_SAILING. This makes the sail
command accept destination sectors as well as paths. Clean up the
case discrimination.
(tend): Fix rev. 1.20: used to send bulletin to last tendee's owner,
unless that's the player, regardless of success. Send them for every
successful tend to a foreign ship.
(owned_and_navigable): Do not check the real sector, only the bmap.
Checking the real sector leaks information, which can be abused to
test whether an arbitrary sector is unfriendly or an inefficient
harbor or bridge, at the cost of some ship mobility (I think).
Initially broken ca. 1993, went through several changes, but the leak
survived them all.
(retreat_ship1): Fix test for seamines. Before, retreating ships
could sweep and hit landmines. The bug fixed in rev. 1.35 is believed
to have masked this bug. Charge mobility for sweeping. Closes
#1346756.
(MINE_LDAMAGE): Change to match damage suffered in lnd_hit_mine().
This increases damage suffered in retreat. Fix info Damage.
(shp_hit_mine): Use MINE_DAMAGE().
(lnd_hit_mine): Use MINE_LDAMAGE().
(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.
(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.
(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.
(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.
(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.
(retreat_ship1, retreat_land1): Use snxtitem_group() instead of
snxtitem() for RET_GROUP. The latter uses player->condarg, which lets
crafty attackers suppress retreat.
(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.
(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.
(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.
(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...
(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...
(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...