Commit graph

2706 commits

Author SHA1 Message Date
a46c7656d2 (servercmd): Fix telegram info prompt. Broken in rev. 1.37. 2007-12-08 17:42:16 +00:00
7e61dff2da (caploss): Sacked capital isn't moved since rev. 1.7. Don't tell the
victim it is.
2007-12-08 17:28:38 +00:00
09a842c1a0 Consistently consider a nation bankrupt when its treasury is
negative.  Some places considered $0 as bankrupt, some didn't.  Fix
the ones that did:
(repo_list): report command misreported countries with $0 as broke.
(init_nats): If you had $0, logging out and back in bankrupted you.
(produce_sect, upd_ship): Failed to build sectors and produce stuff
for countries with $0.
2007-12-08 14:46:40 +00:00
a71ec1459d (status): Round money before checking solvency, and consistently treat
$0 as solvent.  Before, you became bankrupt / solvent when your money
went below / above zero before rounding, but not when you hit zero
exactly.
2007-12-08 14:36:54 +00:00
ab368ce23b (servcmd): Fix recognition of empty C_INFORM broken in rev. 1.37. 2007-12-08 14:27:35 +00:00
4b715e9267 (check_market): Fix missing putnat(). Belatedly clean up after the
removal of automatic loans in rev. 1.18.
2007-12-08 14:17:03 +00:00
d475256cf1 (check_trade): Fix bug that made your money evaporate when you didn't
have enough to pay.  This was aggravated by the removal of automatic
loans in rev. 1.15.  Clean up after that revision, belatedly.
2007-12-08 14:14:31 +00:00
30458959e6 (check_trade): Fix the price quoted to the buyer when he deal falls
through because he can't afford it.
2007-12-08 09:11:11 +00:00
c96761ecee (status): Simplify. No functional change. 2007-12-08 07:33:45 +00:00
3d11b5ecfd (army, fleet, wing): Fix printing of new group broken in rev. 1.13. 2007-12-02 18:33:28 +00:00
98dc6dd0ec Belatedly update section BUGS: relations work since 4.3.0, reject
since 4.3.4, and budget priorities are gone since 4.3.6.

Fix markup.
2007-12-02 17:17:46 +00:00
3b906d099c Fix not to show $ signs in route output. These were last seen in
actual source code as of version 1.0.3, dated May 1989.
2007-12-02 17:01:46 +00:00
e0c9a56eb6 Trim .SA. 2007-12-02 16:49:04 +00:00
321a7219f4 Add route to .SA. 2007-12-02 16:47:54 +00:00
8fe6d37e4a Remove claim that ships and units on missions will not fire support.
It's always been wrong for ships, and land units were changed to match
ships in lndsub.c rev. 1.49.
2007-12-02 16:45:27 +00:00
aa38b1f31b Spelling fixes. 2007-12-02 16:22:15 +00:00
c09d449204 Reject unexpected redirections:
(redir_authorized): New parameter expected, reject when zero.
(doredir): Pass !redir_fp, do not close it.  Before, an unexpected
redirection silently replaced the existing one.
(dopipe): Pass !redir_fp.  Before, an unexpected redirection silently
replaced the existing one, leaking its FILE.
(doexecute): Pass 1.
2007-11-29 06:04:30 +00:00
a29a8f43ab Refactor redirection data structure, no functional change:
(redir_is_pipe): New.
(doredir, dopipe): Set it.
(pipe_fp): Remove.  Users changed to use redir_fp and redir_is_pipe.
2007-11-29 05:31:55 +00:00
bde3d0c17d (prompt, servercmd): Move C_PROMPT code from prompt() to the only call
site that passes C_PROMPT.  No functional change.
2007-11-29 05:17:54 +00:00
e6882c1e7f (servercmd, prompt, doexecute): Refactor: collect control of
executing, input_fd and send_eof in servercmd().  No functional
change.
2007-11-28 07:17:20 +00:00
2dbc45eff7 Flaws in the Empire protocol make redirections within execute next to
impossible to implement correctly, and nested execute practically
useless (#116377).  Catch and refuse those:
(executing): New.
(doexecute, prompt): Set and clear it.
(redir_authorized): Reject if set.
(doexecute, play): Don't signal doexecute() failure through input_fd,
because that screws up up when we're executing already.  Increment
send_eof in doexecute() instead.
(send_eof): External linkage.
2007-11-28 07:10:27 +00:00
51846ec38f (play): Increment send_eof instead of setting it, decrement it instead
of clearing it.  Fixes a race condition: when we got EOF on input_fd
and a failed doexecute() in the same iteration of the loop, only one
EOF cookie was sent, leaving the client hung.
2007-11-28 06:34:33 +00:00
0b058415a1 (play): Close input_fd when execute's done. Broken in rev. 1.1. 2007-11-27 19:55:34 +00:00
Ron Koenderink
90a53439b2 (loc_Exit_Handler, empth_init) [_WIN32]: Correct the function declaration
for loc_Exit_Handler().  Remove unnecessary cast.
2007-11-27 03:29:35 +00:00
Ron Koenderink
1fb8b9af73 New. Support for nightlybuild for SuSE. 2007-11-25 17:35:24 +00:00
a34a5fd23c (chat): New, factored out of flash() and wall().
(flash, wall): Use it.
2007-11-25 14:34:50 +00:00
566223c36b (flash, wall): Use player->comtail[] to find the raw message. The old
hack to find worked only when there were no spaces in flash's first
argument.  Closes #941740.
2007-11-25 14:31:09 +00:00
8b0c965a38 (flash, wall): Remove rev 1.11's bogus input filtering. 2007-11-25 14:28:42 +00:00
698322553a (execute): Use player->comtail[1] instead of player->argp[1]. This
makes execute send everything after the command back to the client
verbatim, not just the first argument (with quotes and funny
characters stripped).  The client always expected that, and got
confused when the server sent something else.
2007-11-25 14:06:53 +00:00
90631d56ed Record raw arguments, to be used in the next changesets:
(player): New member comtail.
(parse): New parameter tail.  Reorder parameter list.
(command, execute): Pass player->comtail.
(player_login, emp_config, do_unit_move): Pass NULL.  No functional
change.
2007-11-25 13:55:52 +00:00
Ron Koenderink
3fcee8ddd1 (set_fert): Limit fertility to 100 instead of 120, like the other
resources
2007-11-24 02:08:19 +00:00
Ron Koenderink
270ac2255a (resnoise): Remove the % from the change message for setsect().
Percent does not make sense for most of the values that can be
changed.
2007-11-24 00:25:11 +00:00
57f589e2e4 (M_XLIGHT, M_CHOPPER): Redundant, remove.
(init_mchr): Don't set them.
(carrier_planes): Use m_nxlight, m_nchoppers instead.
2007-11-23 18:50:46 +00:00
b900866ea8 (take_plane_off_land): Fix stupid pasto in assertion. 2007-11-23 18:39:31 +00:00
bba101eda6 (getilist): Use pln_airbase_ok(). This fixes a number of bugs: planes
stuck in foreign bases, on inefficient ships or land units, or land
units loaded on ships or land units could still intercept.
(can_fly): Remove.
2007-11-23 18:38:10 +00:00
b46191aebb (getilist): Remove bogus fuel check. It was inconsistent with the one
in mission_pln_equip(), which is called from ac_intercept().  The
inconsistency appeared in Empire3, and had no ill effect then.  But
rev. 1.42 screwed up the fuel test here: it made interceptors that
don't use fuel (SAMs) require petrol to be present to fly.
2007-11-23 18:23:06 +00:00
Ron Koenderink
8e430ae2e3 (setsector): Limit fertility to 100 instead of 120, like the other
resources
2007-11-23 13:24:18 +00:00
836833e321 (carrier_planes): New parameter msl.
(carriersatxy, pln_onewaymission): Pass zero.  No functional change.
(pln_airbase_ok): Pass whether the plane is a missile.  This fixes
non-x-light missiles on ships without capability M_FLY.  Broken in
rev. 1.76.  Launch and interdict weren't affected.  Air defense was,
but the stock game has only x-light SAMs.
2007-11-22 19:33:14 +00:00
Ron Koenderink
e143bb585c (nav_ship): Move the special autofeed code to a separate
function nav_load_ship_at_sea().
(nav_load_ship_at_sea): New code. Generalize the autofeed to
support ships with M_OIL.
2007-11-22 12:57:00 +00:00
Ron Koenderink
6597f8a7d6 (nav_ship): Await fish only in water, not just any unowned sector. 2007-11-22 03:46:23 +00:00
Ron Koenderink
87eab4e63a (pln_sel): Remove unused local variables. 2007-11-22 03:21:27 +00:00
a98bac5146 (sendmessage): Internal linkage. 2007-11-18 11:58:30 +00:00
8064ecdb42 Explain briefly why clients may not support execute. 2007-11-18 11:57:34 +00:00
2ba645308e (play): Continue after input read error, treating it like EOF. This
fixes error handling when a script can be opened but not read: it
switches back to standard input.  And it handles errors on standard
input more gracefully: orderly shutdown, buffered output is still
written out.
2007-11-18 09:51:16 +00:00
02a9af06a0 Fix redirections with execute. Redirection consumed the remembered
input, and execute couldn't find it and mistakenly raised the
tampering deity alarm.  Closes #804644:
(saved_bytes): New.
(save_input): Set it.
(forget_input): New.
(seen_input): Don't discard, return a value for forget_input().
(save_input): Return a value for forget_input(), just because it makes
sense.
(input_to_forget, redir_authorized, prompt): Save value of
seen_input() to new input_to_forget in redir_authorized(), pass it to
forget_input() in prompt().
2007-11-18 09:41:59 +00:00
72b01c8ba1 (redir_authorized): New, factored out of users in prepraration of next
changeset.
(doredir, dopipe, doexecute): Use it.
2007-11-18 09:32:16 +00:00
24048a7f12 (save_input, seen_input): Assert argument ends with a newline. 2007-11-18 09:17:49 +00:00
8e77e66338 Remove extraneous declaration that crept into the previous revision. 2007-11-18 08:18:55 +00:00
70a800d648 (ring_discard): Tighten assertion. 2007-11-18 08:17:33 +00:00
aef5b18c1e (doexecute): Fix to set input_fd on failure, so that play() terminates
the execute correctly.  Closes #723756.
2007-11-17 18:57:06 +00:00