Ron Koenderink [Tue, 10 Oct 2006 20:23:19 +0000 (20:23 +0000)]
(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().
(take_casualties): Code for distributing casualties among units did
not make sense, and in its confusion destroyed land land units when it
shouldn't. Minimally invasive fix; code is still ugly and
incomprehensible.
Ron Koenderink [Wed, 4 Oct 2006 01:20:29 +0000 (01:20 +0000)]
(struct ulist): Add abstract reference to types.h to accomodate
the ciruclar reference between struct ulist and union empobj_storage
and struct lndstr.
(produce_sect, finish_sects): Move stop order expiry to end of update,
so that stopped sectors don't repair units. The update sequence
masked this bug until its change in src/lib/update/main.c rev. 1.25,
but use of budget priorities (gone since rev. 1.24) could unmask it.
(sect_has_dock): NAV_CANAL in sect.h rev. 1.36 broke loading in
canals, fix. Can't enforce M_CANAL condition here, so leave it to
callers. Callers don't enforce it either, which means landlocked
ships can load in canals. Oh well.
Ron Koenderink [Fri, 18 Aug 2006 23:32:45 +0000 (23:32 +0000)]
(empobj_chr): New, create a new (imcomplete) structure for
empobj characteristics.
(get_empobj_chr): Update get_empobj_chr() to use new
struct empobj_chr.
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.
Ron Koenderink [Wed, 2 Aug 2006 21:46:34 +0000 (21:46 +0000)]
(makelost, makenotlost, findlost, struct loststr): Change type to be a
short instead of a char. This will make lost_type consistent with
ef_type in the rest of the structures.
Ron Koenderink [Wed, 2 Aug 2006 18:39:22 +0000 (18:39 +0000)]
(unit_map): Replace player->owner with direct owner check and
player->god check. player->owner is not set if ef_ptr() is used
as no post_read() is done. Broken in rev 1.38. Not completely fixed
in rev 1.40.
(ef_open): Lock the file. This prevents two programs (servers in
particular) running on the same game state. fairland does not use
ef_open() at this time, and thus ignores the lock.
(produce): The reported amount produced (returned through last
parameter) did not reflect production cut for ITEM_MAX. Broken in
3.0.14 or so. Reported by Stefan Hauser.
Ron Koenderink [Wed, 26 Jul 2006 00:21:58 +0000 (00:21 +0000)]
(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.
(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.
(update_coastal_flag, coast_sea_to_land, coastal_land_to_sea): Return
new coastal flag instead of updating the sector. This is a bit
simpler. Change arguments from sectors to coordinates to make it
obvious that the sector is not touched.
(set_coastal): Update the coastal flag, but leave putsect() to
callers. All existing callers do that anyway.
Ron Koenderink [Thu, 20 Jul 2006 14:12:35 +0000 (14:12 +0000)]
(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().
Ron Koenderink [Thu, 20 Jul 2006 01:29:25 +0000 (01:29 +0000)]
(prod_nat): Change the wording from "total pop is" to
"total pop was" to be less confusing. The total population
display is the total at the start of the update, not after the
update is complete.
Ron Koenderink [Thu, 13 Jul 2006 21:14:16 +0000 (21:14 +0000)]
[_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.
Ron Koenderink [Wed, 12 Jul 2006 18:14:31 +0000 (18:14 +0000)]
(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.
Ron Koenderink [Tue, 11 Jul 2006 22:30:19 +0000 (22:30 +0000)]
[_WIN32, __GNU__]: Use <string.h> for strncasecmp for MinGW.
MinGW environment has an issue with conversion of strncasecmp()
to support _WIN32 and a definition in <string.h> for strncasecmp().
Poorly worded, many little errors, not enough focus. Rewrite,
basically. Same outline, but almost every sentence is changed.
Replace some details by references. Document show sect properly.
Don't refer to Innards, it's obsolete. Clarify work. Talk about
petrol, not petroleum. Advise that resource depletion is
configurable. Clean up prose somewhat.
Ron Koenderink [Mon, 10 Jul 2006 23:14:26 +0000 (23:14 +0000)]
(obj_nameof): New.
(nameofitem): Remove, switch callers to to obj_nameof().
(mission, show_mission): Convert functions to use obj_nameof()
instead of nameofitem().
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.