Commit graph

726 commits

Author SHA1 Message Date
bebf6a7de0 (GUINEA_PIGS, opt_GUINEA_PIGS, Options): New option GUINEA_PIGS. 2004-12-16 22:01:30 +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
Ron Koenderink
3645ee77c8 (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().

Remove carriage return from comment.
2004-12-16 19:28:17 +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
Marc Olzheim
21761891f0 (EFF_COM,ef_items): No longer in use after removal of 'variables'. Removed.
Clean s_char on the way.
2004-12-16 12:22:58 +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
fd700f235b (getopt.h) move to src/lib/gen directory to prevent conflicts with
/usr/include/getopt.h.
2004-12-15 14:02:07 +00:00
Marc Olzheim
61cb34b7ef (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.
2004-12-14 17:21:05 +00:00
Ron Koenderink
4a6346b0df (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.
2004-12-12 19:39:35 +00:00
Ron Koenderink
afc8667d10 (main) [_WIN32]: Switch to Unix style function for access and mkdir.
(info) [_WIN32]: Switch to standard function for strncasecmp.
2004-12-08 13:10:15 +00:00
Ron Koenderink
97113af8ff (getopt) [_WIN32]: New for parsing command line arguments. 2004-12-08 12:59:28 +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
Marc Olzheim
442803c30a (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.
2004-10-12 19:48:53 +00:00
c85f674059 (mcost): Unused, remove. 2004-10-05 18:41:18 +00:00
Ron Koenderink
66c258b595 Work around for broken MSC C++ 6.0 (VC98) choking on empty macro arguments.
Fixed in MSC C++ 7.0.
2004-10-05 01:08:21 +00:00
1e1f8088a8 (item_prewrite): New.
(checksect, shp_prewrite, lnd_prewrite): Use it.
2004-09-19 07:56:57 +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
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
7d34832100 (fldoff): Use offsetof() instead. Rest of struct.h is unused, remove. 2004-09-10 18:41:58 +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
9dbc1cb5e3 Use plain char * instead of s_char *. 2004-09-10 18:18:31 +00:00
fac342ed49 Update copyright notice. 2004-09-07 15:07:16 +00:00
0f7097c319 Update for 4.2.18. 2004-09-07 14:16:24 +00:00
3dc73b39d2 (NEWS_PERIOD, news_keep_days): Replace macro NEWS_PERIOD by new
configuration key news_keep_days.
2004-09-04 19:32:48 +00:00
d89c268b8b (keymatch): Replace member km_func by km_type. Initializers adapted.
(emp_config, print_config): Cope with km_type.
(worldxset, intset, floatset, optstrset, doubleset, longset): Unused,
remove.

(emp_config): Fail if specified file can't be read or contains errors.
Used to succeed always, returning RET_OK.  RET_OK is not appropriate,
since this is not a command.  Return 0 on success, -1 on failure.
Callers ignore failure at the moment.  A missing or unreadable econfig
file used to be silently ignored.  It is still ignored, but no longer
silently.  It is questionable whether ignoring is wise, but that's
left for another day.

(emp_config): Improve diagnostic messages.

(set_option): Move diagnostics to caller.

(emp_config): Ignore leading whitespace in `#' comment lines.

(print_config): Simplify printing of km_comment.

(set_option): New parameter val, so it can set and clear options.
(delete_option): Remove.

(KM_ALLOC): Turn macro into enumeration constant.

(KM_INTERNAL): New.
(xdump, xdver): New version dump.

(keymatch, infodir, datadir, teldir, upfil, downfil, disablefil,
telfil, annfil, banfil, timestampfil, privname, privlog, update_times,
update_demandtimes, game_days, game_hours): Use plain char * instead
of s_char * for strings, void * for generic pointers.
2004-09-04 08:07:51 +00:00
7a4f133d1c (hard_tech): Unused, remove.
(configkeys): Fix km_flags of key anno_keep_days.
2004-08-30 21:12:15 +00:00
7362ad6c19 Undo the previous revision (bad idea). 2004-08-30 20:28:15 +00:00
cc9efeb13d (EMPCF_COMMENT): New; for readability. 2004-08-30 17:41:39 +00:00
fd4d6b3108 (keymatch, configkeys): Move to from optlist.h to emp_config.c; static
linkage.
2004-08-30 17:36:50 +00:00
8982ff2e18 (pln_arm): Callers don't use parameter tech; remove it. Callers
changed.
2004-08-30 16:13:37 +00:00
f0b4381c98 (ANNO_KEEP_DAYS, anno_keep_days): Replace macro ANNO_KEEP_DAYS by
new configuration key.  Closes #780425.
(delete_old_announcements): Do nothing when anno_keep_days is
negative.
2004-08-28 15:28:54 +00:00
e16e38dfab (trad, set): Treat trade file slots with zero owner as unused, so that
freshly extended trade file makes sense.  When set() removes a lot,
simply zero the slot.

(set): Initialize trd_uid.

(trade_check_ok): Use check_land_ok() & friends instead of doing it by
hand, but wrong.  This fixes bying planes and land units loaded on
ships that moved after loading.

(check_trade_ok): New.
(trade_check_ok): Use it.  Remove unused argument lot.  Callers
changed.
2004-08-28 15:22:50 +00:00
baabcc563e (empth_ctx_t): Unused, remove. 2004-08-28 12:49:13 +00:00
240eb32b76 (last_demand_update): Write-only. Removed. 2004-08-28 09:35:38 +00:00
5ec392227a (IPKG): New.
(ichr): Set IPKG packing bonus for all sectors to 1.
(move): Use it.  No functional change.
(deliver, dodistribute): Use it.  Inefficient sectors now get IPKG
instead of NPKG packing bonus, cutting civilian packing bonus from 10
to 1.

(dodistribute): Export uses the better of sector or distribution
center packing bonus.  Previously, it assumed that distribution center
WPKG packing is always best.  Which is currently true, but needlessly
breaks the abstraction.
2004-08-28 08:43:57 +00:00
92799db17b (dodeliver): Move from sect.c to deliver.c. No functional changes.
(deliver): Static linkage.
2004-08-28 07:10:38 +00:00
eaa90d0590 (getsect, putsect, getsectp): Remove superflous casts, parenthesize
macro parameters properly.
2004-08-23 18:35:50 +00:00
dcfd251f95 caddr_t is obsolete. Replace by void *, except for struct empfile
member cache, which becomes char * to keep pointer arithmetic simple.
2004-08-23 18:29:44 +00:00
059353e957 (sctstr, sect_ca): Make sct_mines signed for same reasons as
sct_item[] (see sect.h rev. 1.10).
2004-08-23 15:50:32 +00:00
ba9748027b (NSC_STRINGY): New.
(nstr_promote, nstr_exec_val): Implement.

(nstr_exec_val): Ignored IDX for NSC_STRING values.

(nstr_exec): Implement NSC_STRING.

(ship_ca): New selector name.
2004-08-21 14:09:31 +00:00
75c03fba80 Doc clarifications. 2004-08-21 13:25:57 +00:00
3e5c0643db (NSC_EXTRA): New.
(sect_ca, NSC_GENITEM, plane_ca, land_ca): Use it for aliases and
cached functions of tech.
(xdflds, xdfldnam): Skip NSC_EXTRA fields.
2004-08-21 12:36:13 +00:00
930b30591a (NSC_NATID): New.
(sect_ca, NSC_GENITEM, nuke_ca, treaty_ca, loan_ca, news_ca, lost_ca,
commodity_ca, trade_ca, nat_ca): Use it.  Fixes sector selector
che_target.

(NSC_IELT, NSC_GENITEM, ship_ca, plane_ca, nuke_ca, treaty_ca,
news_ca, lost_ca, commodity_ca, trade_ca, nat_ca): Fix initializers
for ca_type.  Harmless signed/unsigned mismatches, except for plane
selectors att, def, nuke selector types, treaty selector exp, news
selector time, commodity selectors type, xbuy, ybuy.

(commodity_ca): Remove NSC_DEITY from selector price.
2004-08-21 11:59:23 +00:00
b523740a2b Doc fixes & clarifications. 2004-08-21 11:47:17 +00:00
5e381b6c57 (PLANENAMES, opt_PLANENAMES, Options, plchrstr, plchr_ca, plchr,
main): Remove nooption PLANENAMES.
2004-08-21 06:48:34 +00:00
Marc Olzheim
739a695241 Combine the definitions of include/optlist.h and the use thereof in
src/lib/gen/emp_config.c into a single file: include/econfig-spec.h.
2004-08-20 15:44:24 +00:00
fe50838824 (xdump): New command xdump (experimental).
(player_coms): Add xdump under #if 0.
2004-08-20 12:39:16 +00:00
612f2dadb8 (valstr): Replace member val_as.off by val_as.sym, which contains
offset and index.  This is for the new dumps; conditions can't use it,
yet.
(nstr_comp_val): Zero index.
(nstr_exec_val): Implement index.

(nstr_exec_val): Simplify coercion to WANT.
2004-08-20 12:21:04 +00:00
d1bf11a015 (loan_owed): New, factored out common code.
(coll, fina, repa, shark, disloan): Use it.
2004-08-20 11:46:01 +00:00