Commit graph

535 commits

Author SHA1 Message Date
8db5a84a8f (ship_ca): Fix selector name's ca_len.
(xflds): Ignore ca_len for NSC_STRINGY.
2004-08-30 16:20:05 +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
Ron Koenderink
133c1754f9 (show_land_build, show_plane_build): Adjust the position of the $ column to match
'show ship b'.  Adjust the crew column (show_plane_build) and the adjacent columns
to be right-justified.
2004-08-28 13:52:20 +00:00
a0e7a04f89 (gift): Default case can't happen. Make that explicit for safety and
to silence compiler.
2004-08-28 12:52:34 +00:00
00ba173baa (launch_missile): Simplify to avoid compiler warning. 2004-08-28 12:51:04 +00:00
baabcc563e (empth_ctx_t): Unused, remove. 2004-08-28 12:49:13 +00:00
2eb3b4a4d2 (min_to_next_daytime): Happily returned zero if DTIME happend to be in
TIMES.  This can make callers fire another update right away, possibly
several times.  Observed for update policy UDP_TIMES while updates
were disabled, which makes them complete in much less than a second.
Fills up server.log real fast.  Fix to consider DTIME tomorrow.
2004-08-28 11:24:25 +00:00
240eb32b76 (last_demand_update): Write-only. Removed. 2004-08-28 09:35:38 +00:00
b6d64279b9 Replace incorrect comment on distribution mobility cost by a reference
to info Mobility.
2004-08-28 09:05:27 +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
Marc Olzheim
5ca57434dd retreat.h is unused, remove it. 2004-08-27 16:46:49 +00:00
Marc Olzheim
f7e9440bfe (build_land): unused variable natp, remove. 2004-08-27 16:45:52 +00:00
9c75164a0c (news_ca): Change type of selector action to NSC_TYPEID.
(nat_ca): Split awkward selector level into selectors tech, research,
education and happiness.
2004-08-24 18:54:32 +00:00
a537629d50 (nstr_exec_val): Failed to update category when evaluating symbolic
value.
2004-08-24 18:40:29 +00:00
498fe97332 (chr_camap): Make table names differ from file empfile[] names, so
that they properly identify the dump.
2004-08-24 18:29:09 +00:00
083ce69713 (dchr_ca, intrchr_ca, rpt_ca, tchr_ca): New.
(chr_camap): Use them, but disable rpt_ca[], since rpt[] lacks a
sentinel.

(xhdr): Print `XDUMP' rather than `DUMP' to avoid confusion with old
dumps.  Don't print human readable timestamp.
2004-08-24 15:31:56 +00:00
b74f48fcc9 (improve): Fix confusing diagnostics when refusing to improve defense
because option DEFENSE_INFRA is off.

(improve): Simplify use of `value' to avoid compiler warning.
2004-08-24 08:23:09 +00:00
01e7ea7916 (move, explore): Simplify computation of destination sector's work and
loyalty to get rid of compiler warnings.
2004-08-24 07:08:59 +00:00
c06b330426 (sect_ca): Fix selector che. 2004-08-24 05:54:11 +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
Ron Koenderink
4c4d5b7b94 Removed unnecessary #ifdef's for Windows. 2004-08-21 22:10:10 +00:00
b39e9ba094 (nstr_exec): Fix the previous rev. 2004-08-21 15:06:37 +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
7c4433c54b (sect_ca): New selectors loyal, access.
(NSC_GENITEM): New selector radius.

(ship_ca): New selectors nland, access, xbuilt, ybuilt, builder.

(plane_ca): New selectors access, theta.

(land_ca): New selectors react, nland, access.

(lost_ca): New selector id.
2004-08-21 13:35:35 +00:00
75c03fba80 Doc clarifications. 2004-08-21 13:25:57 +00:00
d12995ff68 Reorder selectors to match struct member order, for easier consistency
checking.
2004-08-21 12:50:58 +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
cd23036995 (ldump): Remove superflous casts. 2004-08-21 12:07:42 +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
0bd79fe5f3 (xdeval): Use NSC_NOTYPE instead of 0.
(xdprval): Cope with NSC_TYPEID.  Check for bad types.
2004-08-21 11:48:59 +00:00
b523740a2b Doc fixes & clarifications. 2004-08-21 11:47:17 +00:00
56be9a66b6 (plchr): Fix the previous rev. 2004-08-21 06:51:49 +00:00
5e381b6c57 (PLANENAMES, opt_PLANENAMES, Options, plchrstr, plchr_ca, plchr,
main): Remove nooption PLANENAMES.
2004-08-21 06:48:34 +00:00
914e21cdfd (xdprval): Passed ptrdiff_t as field width. 2004-08-21 06:20:25 +00:00
Ron Koenderink
7cba668c39 (delete_old_announcements, copy_and_expire): Split off
copy_and_expire() to simplify cleanup.  Previously, cleanup was
missing or incomplete on many less common code paths, which leaked
file descriptors and memory, and could corrupt the anno file.  Use
stdio instead of POSIX I/O for writing.  Check for I/O errors
properly.  Treat bad telegram type just like bad telegram length (give
up).  Closes #1013234.
2004-08-21 00:44:20 +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
19f567bccf Comments, cosmetics. 2004-08-20 13:18:28 +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
2feef76102 Use plain char * instead of s_char *. 2004-08-20 08:55:23 +00:00
bcc4a86944 (fina, repa, shark): Bankers never round down debts!
(repa, coll): Collect interest for the time the debtor is idling at
sub-prompts.
2004-08-20 08:47:00 +00:00
e7c9da21e5 (loan_owed): New, factored out common code.
(coll, fina, repa, shark, disloan): Use it.
2004-08-20 08:16:34 +00:00
e502056dab (fina, repa, disloan): Fix the previous rev. 2004-08-20 07:11:18 +00:00
fcbe36e76c (coll, fina, repa, shark, disloan): Fix calculation of regular and
extended (beyond due date) loan time.  At the due date, or after a
last payment made at the due date, durations were zero in fina() and
unpredictable elsewhere.  With luck, debtors could abuse this to repay
loans cheap (they couldn't gain cash, though), sharks to purchase
loans cheap, and creditors to collect excessively.
2004-08-20 07:01:26 +00:00