Commit graph

59 commits

Author SHA1 Message Date
95ef2b139d (ITEM_MAX): New, value 9999.
(give, deliver_it): Use it instead of 9990.
(load_comm_ship, load_comm_land, rese): Use it instead of 9999.
(thre): Use it instead of 10000.
(check_market, explore, move, pln_dropoff): Use it instead of 32767.
(unload_it): Use it instead of 99999 (which couldn't possibly work,
but what do you expect from the autonav code).
2004-03-05 06:34:34 +00:00
abd1fd2c1e (FALLOUT_MAX): New.
(doland, detonate, spread_fallout): Use it.  With variables, fallout
beyond the capacity of variables (65535) was ignored, except in
doland(), where it saturated at 9999, and spread_fallout, where it
could overflow.  Now it always saturates at FALLOUT_MAX.
2004-03-04 16:19:50 +00:00
828b84d840 (MINES_MAX): New.
(doland, mine, landmine, setsector, pln_dropoff): Use it.  With
variables, mining beyond the capacity of variables (65535) was
ignored.  Now the mines saturate at MINES_MAX.
2004-03-04 15:54:46 +00:00
5bad9875a5 (sctstr): Member sct_che encoded number of che and their target.
Simplify.  Split into member sct_che (number) and sct_che_target.
Users changed.
(get_che_cnum, set_che_cnum, get_che_value, get_che_value): Che
encoding/decoding functions; remove.
(CHE_MAX): Move from var.h to sect.h.
(prsect, doland): Print / edit the new field.
2004-03-04 13:49:25 +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
c1be5d8657 Don't declare things in more than one place. Move some declarations
between headers.  Code is now fully prototyped and compiles cleanly
with gcc -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs
-Wredundant-decls.  Closes #723788.
2004-02-20 20:45:18 +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
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