Ron Koenderink [Thu, 16 Dec 2004 19:40:06 +0000 (19:40 +0000)]
(ac_calc_flak,ac_fireflak,pinflak_planedamage): New ac_calc_flak().
Move common flak damage code from ac_fireflak() and
pinflak_planedamage() to ac_calc_flak().
Ron Koenderink [Thu, 16 Dec 2004 19:28:17 +0000 (19:28 +0000)]
(ac_calc_flak,ac_fireflak,pinflak_planedamage): New ac_calc_flak().
Move common flak damage code from ac_fireflak() and
pinflak_planedamage() to ac_calc_flak().
Marc Olzheim [Thu, 16 Dec 2004 14:17:08 +0000 (14:17 +0000)]
(turn): Change the command to allow for both an MOTD and a no-login
message. Clean 'register' and 's_char' remnants on the way.
Circumvents bug #813167.
Marc Olzheim [Thu, 16 Dec 2004 12:25:56 +0000 (12:25 +0000)]
(EFF_COM,ef_items): No longer in use after removal of 'variables'. Removed.
Clean 'register' and s_char on the way. Remove dead code.
Rename some variables to better reflect their meaning.
Add function comments.
Ron Koenderink [Thu, 16 Dec 2004 11:12:28 +0000 (11:12 +0000)]
(have_looked,have_found,set_have_looked,set_have_found,print_found):
collapse to shiplist function set (add,free,print,on). Fix bug where ship
uid was a unsigned char instead of short. Switch to head pointer instead
of head record with a linked list. Add a free().
Marc Olzheim [Tue, 14 Dec 2004 17:21:05 +0000 (17:21 +0000)]
(ac_airtoair): No need to pass def_own, as the owner of the intercepting
planes is used anyway. Clean up other unaccessed variables in the process.
No functional changes.
Ron Koenderink [Sun, 12 Dec 2004 19:39:35 +0000 (19:39 +0000)]
(sct_pstage, sct_ptime, shp_pstage, shp_ptime, lnd_pstage, lnd_ptime):
Use `short' instead of `unsigned short'. With variables, plague stage
and time were stored unsigned and used signed, which worked. Removal
of variables dropped the conversion to signed, which broke
plague_people() (plague.c rev. 1.6): stage didn't progress correctly
due to catastrophic underflow of time.
Ron Koenderink [Fri, 29 Oct 2004 01:38:06 +0000 (01:38 +0000)]
(dchr): Negative d_cost now means that only deity can designate.
(nullify_objects, do_desi): Simpify designate restrictions of options
NO_LCMS, NO_HCMS, NO_OIL.
(show_sect_build): Suppress printing of sectors only deity can
designate. This was broken in rev. 1.15.
Marc Olzheim [Tue, 12 Oct 2004 20:25:33 +0000 (20:25 +0000)]
(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.
Marc Olzheim [Tue, 12 Oct 2004 19:48:53 +0000 (19:48 +0000)]
(i_type, I_NONE): shift the enum down 1, so that I_NONE does not need to
be skipped or stored in arrays of size I_MAX. I_NONE's int equivalent
becomes -1 by this patch, so all array indices of type i_type have been
checked not to use I_NONE as index. This change reduces the size of the
arrays stored in files.
(shoo): Code to enfore the mobility limit assumed double m were
integer. When 5 * sect.sct_mobil - 4 < nshot < 5 * sect.sct_mobil,
nshot was rounded up to the next multiple of 5. This could shoot more
people than present, resulting in negative population. Before
rev. 1.3, putvar() swept this error under the rug.
(load_it): Loaded negative amount if ship had more cargo than ordered.
This can happen when unload_it() can't unload, e.g. because sector is
full. This can push the sector's amount beyond ITEM_MAX, and can even
overflow to negative amounts.
Marc Olzheim [Thu, 16 Sep 2004 21:18:01 +0000 (21:18 +0000)]
(I_NONE, I_CIVIL, I_MILIT, I_SHELL, I_GUN, I_PETROL, I_IRON, I_DUST,
I_BAR, I_FOOD, I_OIL, I_LCM, I_HCM, I_UW, I_RAD, I_MAX): Turn macros
into enumeration constants.
(i_type): New. Use where appropriate. No functional changes, except
that I_NONE is now catched properly in a few places.
(ship_ca): New selectors xstart, xend, ystart, yend, cargostart,
cargoend, amtstart, amtend (for order) and mobquota, path, follow (for
sail).
(news_ca): New selector uid.
Selectors are now believed to be complete, except for nat_ca[], which
is not used.
(valstr, nstr_exec, nstr_comp_val, nstr_exec_val, xdprval): Support
strings with length limit instead of zero termination.
(ship_ca, land_ca): New selectors rflags, rpath. The latter is such a
string.
Ron Koenderink [Tue, 7 Sep 2004 14:04:19 +0000 (14:04 +0000)]
(info): `info' was not checking for all types of common files in
Windows, therefore could miss info files depending on the status
(archive, read-only). Also changed the error message to user to
provide a more accurate description of the problem. Closes #1018297.