Commit graph

994 commits

Author SHA1 Message Date
2c0416135e (genpower, powcmp): Sort struct powstr powbuf[] instead of struct
powsort order[].  Marginally less efficient, but simpler.
(powsort): Unused, remove.
2006-12-31 13:38:46 +00:00
Ron Koenderink
c6577ef2c5 (get_leader, pr_leader_change): New.
(set_leader, set_flagship): Replace with get_leader() and
pr_leader_change().
2006-12-31 12:31:18 +00:00
a3b52a748c Fix rev. 1.24, which failed to charge mobility for sweeping without
moving.
2006-11-21 22:26:30 +00:00
Ron Koenderink
fd49704a74 (switch_leader): Generalize the code, no functional changes.
(navi): Change switch_flagship() to call switch_leader() instead.
(switch_flagship): Remove, not needed, replaced with switch_leader().
2006-10-10 20:23:19 +00:00
Ron Koenderink
cd8d742392 Combined struct llist and struct mlist into superset struct ulist.
(assa, set_leader, switch_leader, set_flagship, switch_flagship,
take_move_in_mob, get_land, ask_olist, att_get_defense,
get_dlist, get_ototal, get_dtotal, kill_land, att_infect_units,
put_land, att_reacting_units, count_bodies, att_fight,
send_reacting_units_home, take_def, ask_move_in, move_in_land,
lnd_print, lnd_delete, lnd_take_casualty, lnd_takemob,
lnd_sel, lnd_mar, lnd_put, lnd_sweep, contains_engineer,
lnd_check_mines, lnd_list, lnd_mess,
lnd_damage, lnd_easiest_target, lnd_mar_one_sector, shp_sel,
shp_nav, shp_put, shp_sweep, shp_check_one_mines, shp_check_mines,
shp_list, shp_mess, shp_count, shp_damage_one, shp_damage,
shp_contains, most_valuable_ship, shp_easiest_target,
shp_missile_interdiction, notify_coastguard,
shp_view, shp_nav_one_sector, shp_missdef, nav_ship,
fltp_to_list): Switch to struct ulist from either struct mlist
or struct llist.
2006-09-25 03:29:06 +00:00
7d90028f20 (out5): Rev. 1.36. didn't fully fix the format conditional.
Fold negative cases into positive ones.
2006-09-23 15:47:40 +00:00
dbfd0c5aa3 (apro) [!_WIN32]: Silently ignore directory entries starting with '.'.
Before, apro() logged complaints about . and .. not being regular
files.
2006-09-23 15:00:01 +00:00
7a2aad83cb Clean up the previous revision. 2006-09-23 13:25:46 +00:00
251f552088 (tend_land): Fix to not let land units be tended that could not be
loaded.
2006-09-23 08:40:40 +00:00
Ron Koenderink
a9a9957a27 (radar): New, moved functionality from rada() except ef_type determination.
(rada): Call radar() with EF_SHIP.
(lrad): New, call radar() with EF_LAND.
(empmod[]): Call lrad() for lradar command.
(march, navi): Call radar() with appropriate type.
2006-08-16 01:16:30 +00:00
ed88f3140d (EF_IS_VIEW): New.
(xdump): Use it to deny access to views when denying access to game
state.  Fixes the previous revision.
2006-08-13 07:29:30 +00:00
f7233ff841 Allow xdump before break; partial solution for #1417871:
(player_coms): Set xdump's c_permit to VIS.
(xdump): Deny countries that couldn't run xdump before access to game
state.
2006-08-13 07:13:37 +00:00
Ron Koenderink
db541d9b9b (rada): Replace the "unit" text with "land" to be more clear. 2006-08-04 19:59:24 +00:00
Ron Koenderink
90ff9ae2b0 (rada): Using struct empobj to generalize the code. 2006-08-02 22:07:12 +00:00
Ron Koenderink
f246f86542 (gift): Remove the type argument, can be determined from the ptr
argument. Replace prship/prland/prplane/prnuke code with
obj_nameof().
2006-08-02 13:07:09 +00:00
Ron Koenderink
80e5a77e83 (map): Prompt only for sects for map and bmap commands.
Broken in 1.27.
2006-07-26 23:13:52 +00:00
Ron Koenderink
fec9878ca4 (get_empobjp): New. Returns a pointer an empobj.
(emp_obj_chr_name): New. Returns a pointer to the characteristics name
for an empobj.
(unit_map):  Simplify unit_map() by using get_empobjp() and
emp_obj_chr_name().
(map,  cmd_move_map):  Switch to EF_SHIP as unit_map does not default
to EF_SHIP for EF_BAD anymore.
2006-07-26 00:21:58 +00:00
Ron Koenderink
b70653815c (get_empobj_mob_max): New. Return maximum mobility based on ef_type.
(miss): Use new get_empobj_mob_max().
2006-07-24 13:40:12 +00:00
6db2e6ec63 (swaps): Failed to update coastal flags. Was missed in the changeset
containing coastal.c rev. 1.1.
(set_coastal): New parameter olddes, to simplify fixing swaps().
Callers changed.
2006-07-21 18:10:09 +00:00
Ron Koenderink
a62989d4a3 (put_empobj): New. Put generic empobj into the appropriate data file.
(get_empobj_chr): New.  Get characteristics for empobj.
(mission, build_mission_list_type): Switch to use new
functions put_empobj() and get_empobj_chr().
2006-07-20 14:12:35 +00:00
Ron Koenderink
8e7199c338 (march, navi): Provide equivalent functionality to map in move(), expl()
and tran(). Allow map and bmap to access the regular map command
parameters.
2006-07-20 13:33:11 +00:00
Ron Koenderink
911a553a65 (powe): Remove unused local variable.
Remove CR's.
2006-07-13 21:17:00 +00:00
Ron Koenderink
d413884a37 [_WIN32, __GNUC__]: Reorganize the include files for WIN32 to
separate the MinGW environment from the MSVC environment and
WIN32 environment.  Reorganize the order of the includes so
the system files are always loaded first to prevent with misc.h defines.
Remove system file includes from misc.h.
2006-07-13 21:14:16 +00:00
51baf40e90 (powe): Fix `pow n' not to ignore second argument when BTUs don't
suffice for `n'.
2006-07-13 20:07:41 +00:00
b27c7ea77d (powe): Simplify evaluation of arg 1. No functional change. 2006-07-13 19:57:56 +00:00
7282d4d639 (prpower): New, factored out of powe(). No functional change. 2006-07-13 19:41:05 +00:00
a3eb9c0d30 (init_sanct): Spread food evenly among sanctuaries, for simplicity.
Give max_pop() civilians (changes civs from 999 to 1000).
2006-07-13 18:42:34 +00:00
5fdd7546dd (init_sanct): New, factored out of new(). No functional change. 2006-07-13 18:35:17 +00:00
Ron Koenderink
51275c753f (do_map): New. map() was split into two parts map() and do_map().
(map): Call new function do_map().
(display_region_map): Modify to use do_map() instead of map().
(tran_nmap, tran_pmap, cmd_move_map): Modify to accomodate
the modified display_region_map() function.
2006-07-12 18:14:31 +00:00
c72edef30f (vers): Format string fix. 2006-07-11 18:44:33 +00:00
Ron Koenderink
6d90861aae (obj_nameof): New.
(nameofitem): Remove, switch callers to to obj_nameof().
(mission, show_mission): Convert functions to use obj_nameof()
instead of nameofitem().
2006-07-10 23:14:26 +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
Ron Koenderink
f874995c19 (switch_leader, switch_flagship): New.
(navi, marc): Add the ability to select a flagship or leader.
2006-07-09 18:30:13 +00:00
Ron Koenderink
df8dc6ab5a (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.
2006-07-09 18:24:31 +00:00
Ron Koenderink
5ea9060132 (mission, build_mission_list_type, show_mission, oprange): Remove the
type parameter as it can be determined from the empobj parameter.

(oprange): Remove getting the unit information again as it is contained
in the empobj parameter passed in.
2006-07-09 10:57:24 +00:00
a33f1378e8 (starv_sects): Reported food need was one short when the sector had no
food.
2006-07-08 12:47:39 +00:00
Ron Koenderink
79ee88f7c6 (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.
2006-07-07 15:15:43 +00:00
Ron Koenderink
21e34de8dd (tran_nuke): Correct text to nukes. Copy and Paste error. 2006-07-02 18:22:50 +00:00
Ron Koenderink
4d3b9dc77a (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().
2006-06-29 13:46:03 +00:00
Ron Koenderink
274c8e423c (march): Add the ability mine using 'd' while in the march command.
This is the same feature that was added to navi().
2006-06-29 13:38:42 +00:00
Ron Koenderink
fa90c1921f (march): Reorganize, use parse() to split arguments.
These changes are based on improvements made in
navi().
2006-06-29 13:24:55 +00:00
Ron Koenderink
6a07beb3cb (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.
2006-06-29 03:36:14 +00:00
Ron Koenderink
ed176d8856 (navi): Add missing local map for ship list.
Broken in rev 1.27.  Remove unnecessary brackets.
2006-06-29 01:24:34 +00:00
Ron Koenderink
2438fe7c9c (navi): Add the ability mine using 'd' while in the navigate command. 2006-06-28 19:02:21 +00:00
Ron Koenderink
0c12d837cb (navi): Reorganize, use parse() to split arguments. 2006-06-28 13:51:44 +00:00
0cf5c17f08 (move): Don't trigger interdiction when moving stuff that cannot be
harmed (bars with opt_SUPER_BARS enabled).
2006-06-27 05:30:47 +00:00
Ron Koenderink
26a014ea04 (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[].
2006-06-24 17:29:40 +00:00
5091956480 (out5): Conditional chose formats incorrectly, e.g. 9999 was printed
as 10.0K instead of 10K.  Could make power report columns run
together.
2006-06-24 17:09:20 +00:00
d240bad7f8 (ac_flak_dam): Redesign so that code common to all its callers ends up
in this function.
2006-06-24 14:24:23 +00:00
d9c48789fb (pinflak_planedamage): Grant +1 vs. flak only to non-tactical bombers,
for consistency with ac_fireflak().
2006-06-24 14:21:55 +00:00