Commit graph

1281 commits

Author SHA1 Message Date
f8b2860ec5 (prod, nati): Use max_pop() instead of hardcoded values. Before,
struct dchrstr member d_maxpop had no effect in some cases.
2005-02-13 18:25:30 +00:00
41da51e548 (newe): Fix for max_pop() > 999. 2005-02-13 18:25:14 +00:00
afa65c8f27 Break inclusion cycles. To simplify the change, move a few
declarations to other, no less sensible places.
2005-02-12 19:26:59 +00:00
858839f063 (dchr_ca): New selector maxpop. 2005-02-12 17:06:21 +00:00
aa26c53e47 (multifire): If firing at a submarine with something that can't drop
depth charges, don't disclose the target is a submarine.  Old code
allowed players to find all submarine uids.
2005-02-12 16:43:08 +00:00
Ron Koenderink
c0618aec6e (news, fina): Report bad conditionals as syntax error. Closes #775475. 2005-01-06 02:09:30 +00:00
Ron Koenderink
c99a5b4f43 (tend_nxtitem,nxtitem,sarg_type,snxtitem,snxtitem_all,snxtsct,nxtitemp):
change NS_ALL to NS_EVERYTHING in ns_seltype because of a
conflict with winsock2.h which is used in the WIN32 build.
2004-12-31 20:14:10 +00:00
Ron Koenderink
9b56e4d5a0 (rea): Add brackets to prevent 'else' ambiguity. 2004-12-31 14:12:34 +00:00
Ron Koenderink
667b137216 (new) [_WIN32]: Rely on misc.h to provide BSD random functions. 2004-12-30 13:57:04 +00:00
Ron Koenderink
7a95982a21 (multifire) [_WIN32]: Rely on misc.h to provide BSD random functions.
(multifire): switch the random seeding with the current random
value to seeding with the current time.  Seeding with the
current random value does not actually improve the randomness.
2004-12-30 13:53:46 +00:00
Ron Koenderink
cc1a92e512 (rea): Code cleanup. 2004-12-30 01:43:39 +00:00
Ron Koenderink
1a8488bc45 (main,mobility_check,upda,turn,rea,mobupdate,ef_open,logerror,
emp_config,gamedown,show_motd,match_user,typed_wu,
delete_old_announcements) [_WIN32]: switch the default file mode to
binary to match POSIX.  Remove the now unneccessary ifdef for
the open/fopen. Add text mode for user files (econfig/auth).
2004-12-30 01:31:03 +00:00
6ce77efd82 Fix rev. 1.5's placement of braces. No functional changes. 2004-12-21 12:23:01 +00:00
Ron Koenderink
537735f512 switched comment from // format to /* */ format. 2004-12-21 03:16:18 +00:00
46608d6c83 (ORBIT, opt_ORBIT, Options, launch_sat, pdump, plan, prod_plane):
Remove nooption ORBIT.
2004-12-17 19:29:36 +00:00
Marc Olzheim
09b73000c2 "(turn): Fix comparing the output of write() to an unsigned sizeof by
casting the sizeof to write's most used return-type (ssize_t). Introduce
a typedef for ssize_t for WIN32."
2004-12-17 15:39:28 +00:00
0ad644b11b (info): Polish output for ambigous topic argument. 2004-12-17 13:58:10 +00:00
b0ce8c0253 (xdump): Fail unless GUINEA_PIGS is enabled. 2004-12-16 22:05:15 +00:00
Ron Koenderink
2c4b89e2d1 (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().
2004-12-16 19:40:06 +00:00
Marc Olzheim
d9f0f475da (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.
2004-12-16 14:17:08 +00:00
Ron Koenderink
b3f62f7d66 (ship_bomb): Prevent bombing of subs that where not found by the ASW plane. 2004-12-16 12:42:53 +00:00
Ron Koenderink
042372d4c2 (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().
2004-12-16 11:12:28 +00:00
Ron Koenderink
8a8bf00c5e (scuttle_tradeship): Remove carriage return. 2004-12-15 03:00:08 +00:00
Marc Olzheim
1fbbccfe72 (prod): Fix bug #1083175. Use max_pop() not just when opt_RES_POP is
enabled to determine the new working population of a sector.
2004-12-14 19:45:47 +00:00
Marc Olzheim
7a593d9083 (orde,eta_calc): Remove unaccessed leftover variables nships,mcp.
No functional changes.
2004-12-14 17:47:03 +00:00
Marc Olzheim
0847b87afa (ship_bomb,land_bomb): Remove unaccessed leftover variables lcp,onsea.
No functional changes.
2004-12-14 17:43:54 +00:00
Marc Olzheim
70e1ee220f (scut): Remove unaccessed remnants from before 1.1. No functional changes. 2004-12-13 17:36:43 +00:00
Marc Olzheim
c6ef918f3a Cleanup #includes of (mostly a long time) unused header files.
No functional changes.
2004-12-13 16:47:13 +00:00
Ron Koenderink
098f7202b1 (scuttle_tradeships): calculate ally percentage before ally bonus is applied.
Change to match the description in the info page.
2004-12-05 14:14:19 +00:00
6c852f2a56 (prod): Fix rounding of value in column `max'. 2004-11-14 14:13:07 +00:00
Ron Koenderink
d40ea86b61 (info): Print the info topics found when the abbreviation is not unique. Closes #1018302. 2004-11-11 01:58:35 +00:00
Ron Koenderink
8fdd0259f2 (info): Fix when with last character is special.
Also reorganized to check for special characters then blank.

(info): Add length boundary check to filename variable.
Change WIN32 to use the same code.

(info) [_WIN32]: Fix check for invalid file attributes.

(apro): Ensure the user does not see the directory information on error.
See #1028552 for reference.

(apro): Ensure the directories, operating system files, and
hidden files are skipped.
2004-11-10 00:02:29 +00:00
Ron Koenderink
8d792e1b9f (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.
2004-10-29 01:38:06 +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
Marc Olzheim
e9a040adb9 Do not include var.h where no longer needed. Clean up register keywords in these file at the same time. No functional changes. 2004-10-12 20:08:51 +00:00
bf6f2162e8 (new): When first sanctuary is a wilderness, but second isn't, code
complained about the first one.
2004-10-05 18:45:49 +00:00
Ron Koenderink
1b8eaffce4 (info): Don't leak potentially sensitive information to player in
error messages.  Properly log all system errors and return RET_SYS.
Closes #1028552.

(info): Fix use of uninitialized variable when fopen() succeeds but
fstat() or the st_mode check fails.

(info) [_WIN32]: Fix '//' to be '\\'.  Add file type check to prevent
opening hidden or operating system files.
2004-10-05 01:17:08 +00:00
Ron Koenderink
d895fe1d00 Remove the unused/not needed code. 2004-10-03 16:16:05 +00:00
311ad32a88 (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.
2004-09-19 07:16:44 +00:00
57bea595cd (scra): Obey ITEM_MAX. 2004-09-17 12:55:33 +00:00
8b8fba25ed (multifire): Remove some dead code. 2004-09-17 12:54:49 +00:00
5cb994b4fe (do_demo): Simplify. 2004-09-17 12:54:14 +00:00
Marc Olzheim
d30942632b (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.
2004-09-16 21:18:01 +00:00
aa6ad9d791 (NSC_SITYPE): New.
(dchr_ca): Use it to fix selector pkg's ca_type.
2004-09-11 15:25:38 +00:00
630e8e105a (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.
2004-09-11 08:45:17 +00:00
d446db0ac1 (mchr_ca, lchr_ca): Fix selector flag's ca_type.
(xdprval): Make sure floating-point numbers always contain a decimal
point, so they're easily distinguished from integers.
2004-09-10 18:58:30 +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
Ron Koenderink
9e670d8dc7 (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.
2004-09-07 14:04:19 +00:00
5bd904f825 (tran_plane): Fix major, abusable bug: getsect() before move_ground(),
putsect() afterwards.  This allowed two cooperating countries to
duplicate items.

(tran_plane): Don't report interdiction damage twice.

(tran_plane): Simplify loop collecting planes.
2004-09-07 06:34:08 +00:00