Commit graph

1471 commits

Author SHA1 Message Date
Ron Koenderink
ea1e3b6090 (xuflds): Allow multiple spaces to separate fields or symbols in symbol set. 2005-11-30 17:16:02 +00:00
Ron Koenderink
e9ddf6a80b (xunsymbol): Fix formating. 2005-11-30 00:36:35 +00:00
Ron Koenderink
d223865d2b (xuloadrow): Add missing case for VAL_SYMBOL_SET for trailing
junk row check.

(xuskipcommentlines): Make the function static.
2005-11-30 00:33:37 +00:00
Ron Koenderink
bf94174f88 (xuflds, xunsymbol, xuloadrow): Split VAL_SYMBOL into
VAL_SYMBOL and VAL_SYMBOL_SET.  Identify SYMBOL_SET
by the '(' and ')'.  Switch SYMBOL_SET separator from '|' to a space.
2005-11-29 23:55:17 +00:00
Ron Koenderink
125af4b338 (xuskipcommentlines): Include the lines skipped in the line count. 2005-11-29 23:38:32 +00:00
Ron Koenderink
03121d44aa (xundump): Skip lines beginning with '#'.
These lines are considered comments.

(xuskipcommentlines): New.
2005-11-29 21:50:31 +00:00
2517931b12 (plane_bomb, land_bomb): Apply collateral damage to target sector
instead of where the targeted plane/land unit is after the attack.
Different if the target retreats.  Can't happen for planes.  Reported
by Greg German.
2005-11-29 17:54:45 +00:00
f5c81fe39e Fix bad line breaks. 2005-11-29 17:34:42 +00:00
Ron Koenderink
e89fb0bb17 (close_files, finish_server, panic):
Rename close_files() to ef_close_srv() and move to fileinit.c.
Replace calls to close_files() with ef_fin_srv().
Call ef_close_srv() from ef_fin_srv().

(ef_close_srv, ef_fin_srv): New.

(init_files, init_server, ef_init_srv):
Rename init_files() to ef_open_srv() and move to fileinit.c.
Remove call to init_files() from init_server() and replace
with a call to ef_open_srv() from ef_init_srv().

(ef_open_srv): New.

(ef_load, init_server, ef_init_srv):
Move the call to ef_load() from init_server() to ef_init_srv().

(global_init, init_server, ef_init_srv):
Move the call to global_init() from init_server() to ef_init_srv().

(nullify_objects, global_init, init_server):
Split nullify_objects() into init_lchr() and init_dchr().
Locate init_lchr() and init_dchr() in init.c.
Add calls to init_lchr() and to init_dchr() from global_init().

(init_lchr(), init_dchr()): New.
2005-11-29 03:57:44 +00:00
803009d0ce (fillcache, do_write): Revert the previous revision. The portability
issue applies only to sockets, and EWOULDBLOCK isn't defined on all
systems.
2005-11-26 18:36:48 +00:00
Ron Koenderink
9a296c4be3 (show): Return syntax error for invalid qualifier. 2005-11-23 23:51:28 +00:00
Ron Koenderink
e47465570a (mchr[],m_flags,m_nland): Remove M_UNIT from m_flags in mchr[].
It is not used.
2005-11-22 23:19:59 +00:00
Ron Koenderink
d4f52f6ca2 (lookup): Rename lookup() to symbol_by_value(), make it public
and move it to nstr.c.
2005-11-22 22:57:06 +00:00
edaa05b8cb (fillcache, do_write, io_input, io_output): Portability fix: always
check both EAGAIN and EWOULDBLOCK.  These are distinct on some
systems, e.g. HP-UX.
(io_output) [hpux]: Used to treat all errors as EWOULDBLOCK.  This
looks like a inept attempt to `fix' the above.  Remove.
2005-11-22 20:28:18 +00:00
Ron Koenderink
9113969208 (pln_equip): Do not abandon sector for paradrop, drop or fly.
Closes #982226
2005-11-22 20:10:15 +00:00
Ron Koenderink
1de48e53da (tend): Send a bulletin to the ally when tending items to an ally.
Closes #929398.
2005-11-22 19:28:48 +00:00
Ron Koenderink
71641cf712 (kill_cmd): Add authority check for deities before allowing a kill.
Closes #1215088.  Add banned host check before allowing a kill.
2005-11-21 18:35:08 +00:00
Ron Koenderink
779a41c71b (natbyname): Do not look up a non-active country.
Previously a blank country name or deleted country name would
return a pointer to non-active countries.
This creates a security problem where some one can successfully
login into the server without country or password.  Closes #1219569.
2005-11-21 18:25:49 +00:00
Ron Koenderink
f17cedfccd (ship_chr_flags): Add internal flags (M_XLIGHT, M_CHOPPER, M_UNIT)
to ship_chr_flags[].
2005-11-20 22:15:25 +00:00
Ron Koenderink
e8746e9af0 (tend_land): Allow spy units to be tended to and from sub
with no land unit carrying capability.  Closes #1313537.
2005-11-20 18:17:05 +00:00
fdec6a8aae (dchrstr, pchrstr, rptstr): New member d_uid, p_uid, r_uid.
(dchr, bigcity_dchr, pchr, rpt): Initialize it.
(dchr_ca, pchr_ca, rpt_ca): New selector uid for it.
2005-11-19 17:37:43 +00:00
661b650c1a (ef_write): Don't memcpy() onto itself; behavior's undefined. 2005-11-19 15:41:37 +00:00
fe1a3e57c6 (multifire): When an argument is bad, do not loop prompting, just
fail.  That's what the vast majority of commands do.
2005-11-19 15:38:53 +00:00
1c703efa96 (player_coms): Document second argument of launch. 2005-11-19 15:31:16 +00:00
ad10ee5649 (laun, launch_as, launch_missile, launch_sat): When an argument is
bad, do not loop prompting, just fail.  That's what the vast majority
of commands do.

(launch_as, launch_missile, launch_sat): Don't zap the target
argument.  If the target is given as argument, launch all missiles at
that target.  Previously, missiles after the first prompted for
another target.
2005-11-19 15:29:12 +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
3fd64ccb48 (getcontact,putcontact): Generalize the interface back to an int.
Add range checks to prevent unexpected results.
2005-11-19 14:55:03 +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
3d68c0a0da (plurize): Fix the max. string length calculation for the 'y' case.
It was off by one because 'y' is removed from the string.
2005-11-19 12:11:09 +00:00
Ron Koenderink
c345ab82d3 (nat_ca): Add nat_contact to nat_ca[]. 2005-11-19 12:07:52 +00:00
f3fb9c3c4e (cons_choose): When an argument is bad, do not loop prompting, just
fail.  That's what the vast majority of commands do.
2005-11-19 11:27:03 +00:00
d575d779ad (ef_ptr, ef_read): Undo rev. 1.52 for these two, because there are
callers that rely on these functions to fail for bad ID.
2005-11-19 11:20:13 +00:00
69582d0d15 (add): When an argument is bad, do not loop prompting, just fail.
That's what the vast majority of commands do.

(add): Do not silently truncate country number argument.

(add): Diagnostics were confusing because they lacked context.
2005-11-19 10:54:05 +00:00
cea58c40b0 The previous revision accidentally deleted commented out code.
Restore.
2005-11-19 09:53:22 +00:00
Ron Koenderink
762d39d905 (getcontact, putcontact, nat_contact): Change nat_contact
to unsigned char to reduce the space required for natstr.
2005-11-18 23:40:30 +00:00
Ron Koenderink
ac25058b50 (prod_nat): Remove non-functional aging code for nat_contact.
Remove nat_contact debugging from server log.

(update_main, prod_nat): Move aging code for nat_contact
from update_main to prod_nat.
2005-11-18 23:23:04 +00:00
Ron Koenderink
974af7130c (agecontact): Remove the opt_LOSE_CONTACT, the calling
procedure update_main() already has opt_LOSE_CONTACT check.
2005-11-18 23:02:51 +00:00
Ron Koenderink
09b2530d97 (getcontact, putcontact): Remove the bit shifting that was in the
function to save space.  opt_LOSE_CONTACT changes negated
any space saving.
2005-11-18 22:58:54 +00:00
Ron Koenderink
7b94794365 (cens, desi, dump, do_desi, doland, file_sct_init, grow_continents)
(grow_islands, set_coastal, update_coastal_flag, coast_sea_to_land)
(coast_land_to_sea): Determine sct_coastal flag when the sector type
is set.  Old method only updated the sct_coastal flag when doing
cens() or a dump().  Other uses of sct_coastal could get stale values,
including selector coastal.  Rework set_coastal() into NEW functions
update_coastal_flag(), coast_sea_to_land(), coast_land_to_sea() and
set_coastal().  Fix a bug where the deity designation would not
properly set the coastal flag.  Fix a bug where the one sector lake
would not properly compute coastal flag.  Fix a bug that makes
fairland treat the last sector it adds to an island as non-coastal.
2005-11-17 03:21:32 +00:00
Ron Koenderink
8f98e53a23 (file_sct_init, main, fl_sct_init, write_sects): Assign sct_timestamp with the
time the sector was created in files and fairland programs.
2005-11-17 02:20:28 +00:00
Ron Koenderink
2ce7ab4178 (add): Convert bridge spans or bridge towers into sea sectors instead the
wilderness sectors when wiping sectors.
2005-11-16 13:11:54 +00:00
Ron Koenderink
6b434ee376 (cens, cens_hdr): Print the actual old_owner instead of just a star
when different.  This is change the format for the census output.
2005-11-15 23:44:38 +00:00
Ron Koenderink
94a0f81f24 (plurize): Change variable name max_len to size to improve readability. 2005-11-14 19:01:36 +00:00
Ron Koenderink
58133fe575 (plurize): Fix initial length check to check for zero length of buf
not non-zero lengths of buf.

(plurize): Change variable name size to len to improve readability.
2005-11-14 18:11:46 +00:00
Marc Olzheim
079c231c7e Update patch for src/lib/commands/mfir.c:1.26,src/server/main.c :1.79,include/prototypes.h:1.98 2005-11-14 16:35:33 +00:00
Ron Koenderink
a2798857cf (fuel, load, prod, max_population, shp_nav_one_sector,
nav_loadship, upd_buildeff): Identify BIG_CITY
(IS_BIG_CITY) by using packing type of UPKG instead of
opt_BIG_CITY and sector type of SCT_CAPITAL.
2005-11-14 13:52:12 +00:00
Ron Koenderink
d581485d32 (plurize): Fix the strncat() len parameter to prevent an overflow of buf.
(numstr, esplur, splur, iesplur, plurize): Move the prototype defintions from
misc.h to prototypes.h.  Remove unneccessary headers in plur.c.
2005-11-13 23:18:37 +00:00
Ron Koenderink
fdcbb5912d (budg): Create the capital/city name from the d_name field instead of
hard coding the strings.

(plurize): New.
2005-11-13 21:23:44 +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