Commit graph

1386 commits

Author SHA1 Message Date
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
Ron Koenderink
555de3100c (dchr_ca, packing, empfile): Add packing symbol table.
(sect_ca, ship_ca, land_ca, plague_stages, empfile):
Add plague stages symbol table.

(treaty_ca, loan_ca, agreement_statuses, empfile):
Add agreement status symbol table.
Combine treatystatuses (TS_FREE, TS_SIGNED and TS_PENDING)
and loan statuses (LS_FREE, LS_SIGNED and LS_PENDING)
into a single agreement status.

(pchr_ca, level, empfile): Add packing symbol table.
2005-11-13 12:27:02 +00:00
Ron Koenderink
733f747a36 (output): Remove C_FLUSH from output() as C_FLUSH is dealt with
by servercmd() and output() is not called from servercmd() with a
code of C_FLUSH.
2005-11-13 12:23:17 +00:00
Ron Koenderink
50e4ef3e39 (xunsymbol): Fix xunsymbol() to parse multiple symbols for a
symbol_set (NSC_BITS).
2005-11-13 01:45:39 +00:00
Ron Koenderink
ede257e8f2 (xundump): Add prototypes.h to get a prototype for
xundump().
2005-11-13 00:34:24 +00:00
Ron Koenderink
b7be1fe113 (servercmd): Remove newline for C_INFORM, C_FLUSH,
C_REDIR, C_PIPE and C_EXECUTE.
Fixes the problem created when the newline was left in io_gets().
2005-11-12 20:16:07 +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
caaee8cafa (dchr_ca): prd indexes product table. 2005-11-12 17:32:32 +00:00
af824c3ed1 (EF_MISSION_FLAGS, EF_MISSIONS, mission_flags, missions): Rename, as
these are not flags.
2005-11-12 17:29:11 +00:00
Ron Koenderink
d8422caa84 (init_server, ef_load, xundump): Add ability to customize game
configurations.  The custom game configurations are loaded via
text files in the data directory.  Closes #752881.
2005-11-12 16:53:52 +00:00
Ron Koenderink
0918d3c3fc (io_gets, output): Remove the removal of \n in io_gets() and the
readdition of it in output().
2005-11-12 16:40:38 +00:00
Ron Koenderink
89e2b3b481 (servercmd, io_gets, output): Fix client to read lines longer than
1024 bytes from the server.  Closes #1223255.
2005-11-12 14:20:46 +00:00
Ron Koenderink
0b15696223 (xdump): Add EF_MAX check for table selection by number.
Fixes a crash when selecting a table over EF_MAX.
2005-11-12 13:38:01 +00:00
Ron Koenderink
0a44c4893e (plane_flags, plane_ca): Add plane flags table.
(retreat_flags, ship_ca, land_ca, plane_ca): Add retreat flags table.

(nation_flags, nation_relations, nat_ca): Add nation flags and
nation relations tables.

(empfile_ca): Remove flags and file name fields.
They are internal and not needed by the client.
2005-11-09 22:56:43 +00:00
fd237f1722 (start_server, empth_start): Passed uninitialized sa_mask to
sigaction().  This used to broken only when SA_SIGINFO wasn't defined,
until main.c rev. 1.46 and pthread.c rev. 1.10 broke it
unconditionally.
2005-11-08 21:42:38 +00:00
66201f9d45 Fix bad line break. 2005-11-07 07:55:12 +00:00
4fb17a62c0 (ef_init_chr): Sentinel names are now null, simplify sentinel check. 2005-11-07 07:54:16 +00:00
Ron Koenderink
9200b7f84b (init_server): Remove ef_load() call.
New function not ready yet, incorrectly
checked-in.
2005-11-07 00:07:25 +00:00
Ron Koenderink
d85323c476 (itm_maxno): Remove itm_maxno, it is not used. 2005-11-06 23:44:35 +00:00
Ron Koenderink
9ed76e90ac (nullify_objects): Fix sentinel row checks for plchr, lchr and mchr loops. 2005-11-06 23:42:42 +00:00
e23d8a8fac (shp_maxno): Variable's value is well-known constant N_MAXSHIPS + 1.
Useless, remove.  Users changed to check mchr's sentinel, because
that's clearer than comparing the index to N_MAXSHIPS or sizeof(mchr)
/ sizeof(*mchr).

(mchr): Change sentinel's m_name to NULL.
2005-11-06 21:20:49 +00:00
47192c9079 (pln_maxno): Variable's value is well-known constant N_MAXPLANE + 1.
Useless, remove.  Users changed to check plchr's sentinel, because
that's clearer than comparing the index to N_MAXPLANE or sizeof(plchr)
/ sizeof(*plchr).

(plchr): Change sentinel's pl_name to NULL.
2005-11-06 21:12:24 +00:00
6f1df90b69 (pstat): Remove inappropriate plane sanity check; should be done
elsewhere.
2005-11-06 21:06:35 +00:00
04c247f2da (lnd_maxno): Variable's value is well-known constant N_MAXLAND + 1.
Useless, remove.  Users changed to check lchr's sentinel, because
that's clearer than comparing the index to N_MAXLAND or sizeof(lchr) /
sizeof(*lchr).

(lchr): Change sentinel's l_name to NULL.
2005-11-06 20:59:38 +00:00
190cbaadf2 (carg, lcarg, fort, land, ldump, lsta, orde, payo, retr, lretr)
(cmd_sail_ship, cmd_unsail_ship, show_sail, sdump, shi, sstat, work):
Remove inappropriate ship/land sanity checks; should be done
elsewhere.
2005-11-06 20:54:59 +00:00
a7aea6c468 (show_nuke_build, show_nuke_capab): Simplify. 2005-11-06 20:37:57 +00:00
8c6529ded3 (nuk_maxno): Variable's value is well-known constant N_MAXNUKE + 1.
Useless, remove.  Users changed to check nchr's sentinel, because
that's clearer than comparing the index to N_MAXNUKE or sizeof(nchr) /
sizeof(*nchr).

(nchr): Change sentinel's n_name to NULL.
2005-11-06 20:37:07 +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
100d0fc495 (arm, tran_nuke): Lookup of the nuke name was broken by nuke.h
rev. 1.10.  Replace by typematch().

(arm): Simplify search for nuke at sector.
2005-11-06 20:01:51 +00:00
19953e6c22 (prd_maxno): Variable's value is well-known constant P_MDUST + 2.
Useless, remove.  Users changed to check pchr's sentinel, because
that's clearer than comparing the index to P_MDUST or sizeof(pchr) /
sizeof(*pchr).

(pchr): Change sentinel's p_name and p_sname to NULL.  Sentinel
checks changed.
2005-11-06 18:06:38 +00:00
Ron Koenderink
23f134aa75 (empfile,mission_flags,ship_ca,land_ca,plane_ca): Add mission flags table. 2005-11-06 13:43:09 +00:00
bee3f4aa88 (nullify_objects): Fix option NO_OIL. The attempt to remove ships
with capability M_OIL from mchr[] actually replaced them with
sentinels.  Just clear the capability instead.
2005-11-06 12:06:10 +00:00
610b1cded4 (xdopt, xdver): Simplify the previous rev.
(xdump): Support selecting a dump by table number in addition to name.
2005-11-06 11:05:48 +00:00
5173f8cd07 (ef_ptr, ef_read): Oops on bad ID. Some callers rely on these
functions to fail at the end of the table.  To support that, the first
ID beyond the end is not considered bad.

(ef_ensure_space): Oops on bad ID.
2005-11-06 11:01:37 +00:00
Ron Koenderink
8d03e1ce8e (NSC_BITS): Remove the trailing comma as it is last row. 2005-11-05 20:25:16 +00:00
Ron Koenderink
613a9c52db (install_service): Use the compiled in default for location of econfig
when the -e is not specified while creating a service.
2005-11-05 20:05:38 +00:00