Ron Koenderink [Sun, 9 Jul 2006 18:24:31 +0000 (18:24 +0000)]
(tran_map, tran_nmap, tran_pmap): Split tran_map() into tran_nmap()
and tran_pmap() so that unit number arguments are interpreted
sensibly. Users changed.
(display_region_map): New.
(cmd_move_map, tran_nmap, tran_pmap): Use it.
(LND_AMM): Became weird in 4.2.3: ammo use depends on l_dam if l_ammo
is non-zero; actual value of non-zero l_ammo was unimportant. Side
effect: it substantially increased ammunition consumption at high
tech, because the change made the value increase with tech. Back out
4.2.3's change, just use l_ammo. This lets deities customize
ammunition consumption independent of damage. Remove second
parameter. Callers changed.
Ron Koenderink [Fri, 7 Jul 2006 15:15:43 +0000 (15:15 +0000)]
(nxtitemp, trade_getitem, trade_desc, trade_check_item_ok, nxtitem,
oprange, show_mission, nameofitem, build_mission_list_type,
unit_map, xdvisible, trdswitchown, ontradingblock, trad, check_trade,
unit_type_name, start_stop_unit, scut, scra, mission, multifire,
perform_mission, fuel, NSC_GENITEM): Replace struct genitem with
struct empobj. Remove genitem.h and create a new file empobj.h.
Replace multiple instances of unions of ef_type structures with
one standard union empobj_storage which is a superset of the individual
instances.
Ron Koenderink [Thu, 29 Jun 2006 13:46:03 +0000 (13:46 +0000)]
(march): Modify map and bmap command options for march() to support
an user specified land unit number.
Without an user specified land unit number it will still default to the leader.
This will map and bmap commands consistent with commands like radar
and look. This is the same feature that was added to navi().
Ron Koenderink [Thu, 29 Jun 2006 03:36:14 +0000 (03:36 +0000)]
(navi): Modify map and bmap command options for navi() to support
an user specified ship number.
Without an user specified ship number it will still default to the flagship.
This will make map and bmap commands consistent with commands
like radar, sonar and look.
Ron Koenderink [Sat, 24 Jun 2006 17:29:40 +0000 (17:29 +0000)]
(map, unit_map, draw_map, player_coms[]):
Modify nmap command to allow mapping around a nuke.
Add new command nbmap for bmapping around a nuke.
Add a new mapping flag 'n' for adding nukes to a map.
Correct syntax description for pmap, pbmap, lmap and lbmap
in player_coms[].
Support definition of additional sector types in sector.config,
missing bits:
(budg, calc_all, update_main): Use SCT_TYPE_MAX instead of SCT_MAXDEF
to size tables.
(map_char): Update sanity check; use CANT_HAPPEN().
(show_sect_build, show_sect_stats, show_sect_capab): Use the sentinel
instead of SCT_MAXDEF.
Support definition of additional sector types in sector.config:
(SCT_TYPE_MAX): New.
(dchr): Use it instead of SCT_MAXDEF to size the table.
(SCT_EFFIC): Likewise. Move from sect.h to budg.h.
Rewrite rev. 1.69 to suppress immutable field match check when
extending any table, empty or not:
(cur_obj_is_blank): New.
(fldval_must_match): Use it instead of initialized[].
(getobj): Set it along with cur_obj.
(setstr): Move fldval_must_match() down, so that cur_obj_is_blank is
defined.
(initialized): Remove.
(SCT_MAXDEF): Make it equal the maximum sector type, not the maximum
plus one. Users changed. This indirectly fixes off-by-one loop
bounds in budg(), show_sect_build(), show_sect_stats() and
show_sect_capab(). The show bugs were harmless: the loops ran into
the sentinel, which they ignore. The budg bug was serious: the loop
ran into the entries for SCT_EFFIC. This lead to a bogus line in the
budget, printing of a null pointer, and doubled sector build cost.
Budget priorities masked this bug until rev. 1.25.
_exit() fails to terminate all threads on at least some versions of
LinuxThreads, use exit() where possible:
(shutdwn): No longer a signal handler, can safely call exit().
(main, loc_NTInit): No obvious reason for not using exit().
(bestownedpath): Back out rev. 1.22's path termination with 'h' for
now. Consistency with BestLandPath() is nice, but it makes navigate
behave differently, and that wasn't intended.
(navi, march): Simplify convoluted logic. Old code tried path finding
whenever the next direction in the path string is bad. It then passed
the whole path string to shp_path(), which makes no sense unless we're
at the beginning of it, but luckily failed in that case. Change to
try path finding right after prompting for new input.
(ask_olist): Let land units attack as long as they have positive
mobility, except for high-mobility terrain (mountains), where the
rules remain as they were: land units need to have all the mobility
charged for the attack, not counting combat and moving in to occupy.
Rationale: Making sure your land units reach attack positions with
enough mobility left is a pain in the neck. Requiring only positive
mobility is friendlier, but allows rushing of mountains.
(dchrstr): Replace int members d_mcst and d_emcst (mobility cost * 5)
by float d_mob0 and d_mob1 (straight costs). Impassable terrain now
encoded as negative d_mob0 instead of zero d_mcst. Users changed.
sect.config updated.
(dchr_ca): Replace selectors mcst and emcst by mob0 and mob1.
(show_sect_stats): Show real mobility costs.
(sctintrins): New member in_enable. Update infra.config. Use it
instead of opt_DEFENSE_INFRA.
(improve): Test for it.
(show_sect_build): Show only enabled infrastructure.
(opt_DEFENSE_INFRA): Remove. Deities can edit infra.config instead.