Commit graph

97 commits

Author SHA1 Message Date
6f4a630e9a (buil): Clarify. 2006-04-30 16:20:14 +00:00
a988b907fc s_char purge directed by compiler warnings. 2006-04-29 06:41:45 +00:00
25fd374d53 Update known contributors comment. 2006-04-26 18:14:54 +00:00
6fee3f4535 (CANT_REACH): New. Use it instead of CANT_HAPPEN() where possible.
(oops): Cope with NULL argument passed by CANT_REACH().
2006-04-17 17:36:07 +00:00
4836f6c543 Fix long lines. No functional changes. 2006-04-16 17:20:33 +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
f5a9284867 Update known contributors comment. 2006-02-24 21:35:27 +00:00
Ron Koenderink
b7d0b66161 (buil, drnuke_const, opt_DRNUKE, show, show_nuke_build)
(show_nuke_capab, vers, xdvisible, build.t, Options.t):
Remove opt_DRNUKE and replace with the following check
drnuke_const > MIN_DRNUKE_CONST.
Set MIN_DRNUKE_CONST to 0.001 to prevent issues with tiny values.
Change the default drnuke_const to 0.0 because in the stock game
opt_DRNUKE was disabled.
2006-02-16 02:14:08 +00:00
d5f6d74d05 (buil): Fix rev. 1.32: information on how to list nukes was incorrect
for opt_DRNUKE.
2006-02-15 19:47:56 +00:00
4515b84c59 COPYING duplicates information from README. Remove. Move GPL from
LICENSE to COPYING, because that's where it usually is.  Update all
the references to these files.
2006-01-21 19:48:41 +00:00
3e400c018c Update copyright notice. 2006-01-05 13:36:57 +00:00
3aebb68ee7 Include config.h. 2005-12-27 18:04:19 +00:00
011fa326d7 (buil): When an argument is bad, do not offer to list types, just
print how to list them.

(buil): When an argument is bad, do not loop prompting, just
fail.  That's what the vast majority of commands do.
2005-11-19 15:15:49 +00:00
Ron Koenderink
4e317e3999 (buil): Remove N_NEUT check. It should have been
removed when the opt_NEUTRON was removed.
2005-11-19 12:17:30 +00:00
Ron Koenderink
2f1b7cd2a3 (opt_NO_LCMS, opt_NO_HCMS, opt_NO_OIL, Options,
buil, show_bridge, show_tower, nullify_objects):
Remove NO_LCMS, NO_HCMS, and NO_OIL options, not used.
Functionality can be emulated by modifiying the characteristics files.
2005-11-13 16:39:27 +00:00
Ron Koenderink
0a63d324ca (opt_NEUTRON, buil, denotate, show_nuke_capab, show_nuke_build,
Options): Remove opt_NEUTRON option.  The option can be emulated
by manipulating the flags in a nuke characteristics file.
2005-11-13 12:30:37 +00:00
Ron Koenderink
2e655eaf96 (buil, vers, opt_NONUKES, show_nuke_build, show_nuke_capab):
Remove opt_NONUKES options.  A nuke characteristics file can
be created with no entries to create the emulate the removed option.
2005-11-12 20:09:11 +00:00
856539fc54 (buil): Use typematch() to search for ship, plane, land unit and nuke
type.  The old code didn't work correctly when "sbb  super battleship"
came before "sb   submarine" in mchr[].
2005-11-06 20:14:28 +00:00
c41c45be61 Delete some code that has been disabled out for ages and looks
useless or wrong.
2005-07-23 18:35:07 +00:00
4f59fc9967 Remove a bunch of redundant casts. 2005-06-12 06:31:48 +00:00
Ron Koenderink
dcd0794104 (build_bridge,build_tower,retreat_ship1): Mark "X" on sector
where mines were found when retreating.  Remove "X" when the
bridge span or tower is built.  Closes #1149809.
The bmap is now updated when the bridge span or tower is built.
A bulletin was added for when mines were swept when
retreating.
2005-05-08 18:39:09 +00:00
345ad3dfe0 Update copyright notice. 2005-03-16 22:03:16 +00:00
Marc Olzheim
39facfbf53 (var.h, plague.h): Since all that was left in var.h were some plague
defines, import these defines into plague.h, drop var.h and include
plague.h where appropriate.
Remove some 'register' keywords at the same time.
No functional changes.
2004-10-12 20:25:33 +00:00
65bb65f63d (plnstr): Member pln_fuel was always equal to plchr[pln_type].pl_fuel.
Replace all uses, so pln_fuel can be removed later.
2004-09-10 18:27:53 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
Marc Olzheim
5ca57434dd retreat.h is unused, remove it. 2004-08-27 16:46:49 +00:00
Marc Olzheim
f7e9440bfe (build_land): unused variable natp, remove. 2004-08-27 16:45:52 +00:00
cf991ed5ea Fix missing include. 2004-05-17 06:15:31 +00:00
c2debd73fc (shp_set_tech, pln_set_tech, lnd_set_tech): New, factored out of build
and upgrade code.
(build_ship, build_plane, build_land, supgr, pupgr, lupgr): Use them.
Upgrading planes no longer sets plane range to maximum.

(pupgr): Just clear the mission, don't bother to clear op area.

(doship, doplane, dounit): Editing tech now updates stats, like an
upgrade command.  Proper range checking.
(warn_deprecated): New.
(pr_ship, doship): Deprecate key 'D'.
(pr_land, dounit): Deprecate key 'A' and 'D'.
2004-05-16 14:19:38 +00:00
17494e74d1 (SCT_BLD_WORK, SHP_BLD_WORK, PLN_BLD_WORK, LND_BLD_WORK,
NUK_BLD_WORK): New, to encapsulate the formula in one place.

(SCT_MINEFF): New.  Use it instead of literal 20.

(buil): Use CANT_HAPPEN() for internal error.

(build_ship, build_land, build_bridge, build_nuke, build_plane,
build_tower): Simplify avail calculation.

(lupgr, supgr, pupgr): Charge 15% of total build avail instead of an
undocumented amount computed from build lcm and hcm.

(build_ship, build_land, build_bridge, build_nuke, build_plane,
build_tower, lupgr, supgr, pupgr): Fix reporting of required avail
when there's not enough.  Closes #942823.

(lupgr, supgr, pupgr): Code printed cost rounded down, but required
and charged unrounded cost.  Confusing.  Round cost down, like the
build command.  Closes #942811.

(UPGR_COST, UPGR_EFF, lupgr, supgr, pupgr): New UPGR_COST, UPGR_COST replace
literal values.

(show_bridge, show_tower): Don't claim bridge building requires
`workers' (whatever that is), since it doesn't.
2004-05-15 13:23:39 +00:00
e42f7e8210 (build_ship, orde, qorde, nav_loadship, load_it, unload_it): Store
item types instead of mnemo characters in shpstr members shp_tstart[]
and shp_tend[].
(com_num): No longer used, remove.

(orde): Simplify swap code.

(prhold): New, factored out of qorde().
2004-04-08 19:14:09 +00:00
4ad649950e (buil): Work directly on item arrays instead of copies made by
getvec().  This is safe, because the old code made single copies and
always flushed them back into the unit structures before flushing
those.
(build_ship, build_land, build_bridge, build_nuke, build_plane,
build_tower): Change parameter type to match uncopied item arrays.
2004-03-09 14:52:21 +00:00
eccc5cb7d7 Sectors need space for items, deliveries and distribution thresholds.
To save space, the ancients invented `variables': a collection of
key-value pairs, missing means zero value, space for `enough' keys.
This complicates the code, as assigning to a `variable' can fail for
lack of space.  Over time, `enough' increased, and for quite some time
now `variables' have been *wasting* space.  This changeset replaces
them, except in struct mchrstr, struct lchrstr and struct pchrstr,
where they are read-only, and will be replaced later.  It is only a
first step; further cleanup is required.  To simplify and minimize
this necessarily huge changeset, the new item[] arrays have an unused
slot 0, and the old variable types V_CIVIL, ... are still defined, but
must have the same values as the item types I_CIVIL, ...
2004-03-03 16:54:22 +00:00
bb811df758 (genitem, ship, plane, land): Remove unused member sell & equivalents.
(genitem_ca, ship_ca, plane_ca, land_ca): Remove selector "sell".
(comstr, trdstr): Members trd_price, com_price have no effect.  Use
them instead of trd_maxprice, com_maxprice and remove the latter.
(commodity_ca, trade_ca): Remove selector "maxprice".
2004-03-01 17:21:40 +00:00
46da1aec7a deity.h is redundant, remove it. 2004-02-20 20:34:43 +00:00
4a3f0b8146 Add some missing declarations to headers. Remove some redundant
declarations elsewhere.  Change linkage of some functions to static.
2004-02-20 10:51:03 +00:00
b5401d9dd4 <string.h> is ISO C, no need to #if it. 2004-02-19 10:05:53 +00:00
8cd0160176 Declare all configuration variables in optlist.h. Include that
instead of declaring them all over the place.  This uncovered type
errors:
(s_p_etu, adj_update): Defined long, sometimes declared int.  Kills
big endian machines where sizeof(long) != sizeof(int).  Change to
int.

(set_option, delete_option, optstrset, intset, floatset, doubleset,
longset, optionset, optiondel, worldxset): Change linkage to static.
2004-02-17 22:58:04 +00:00
237baffca9 Supply prototypes where possible. This uncovered type errors with
thread entrypoints:
(lwpSelect, shutdown_sequence): Parameters didn't match thread entry
point prototype.
(lwpEntryPoint): Arguments didn't match thread entry point prototype.

Change linkage of functions without prototype declaration to static
where possible.

Remove some superflous declarations, replace others by suitable
includes.
2004-02-17 17:59:30 +00:00
0696bb190d Indentation fix. 2004-02-06 23:26:25 +00:00
4ae9c417b3 (bzero, bcopy): Obsolete BSDisms; remove. Remove some calls without
effect.  Replace calls by struct assignment where possible.  Replace
clear buffer, copy string to buffer by strncpy().  Use assignment to
clear when that's clearer.  Replace overlapping copy through bounce
buffer by memmove().  Replace rest by standard memset() and memcpy().
Also use sizeof() instead of literal array sizes for robustness, and
instead of symbolic array sizes for clarity.
2004-01-08 17:54:28 +00:00
d8cb7c48f0 Cosmetics. 2003-12-17 21:26:26 +00:00
9b7adfbecc Indented with src/scripts/indent-emp. 2003-09-02 20:48:48 +00:00
d8b7fdfae1 Import of Empire 4.2.12 2003-08-23 12:23:04 +00:00