Commit graph

3019 commits

Author SHA1 Message Date
13d0fc7077 Avoid compiler warning 2008-05-05 21:54:02 +02:00
abd64835c7 Update change log again for 4.3.14 2008-05-05 06:57:42 +02:00
fe5b26658d Fix fire not to disclose retreat and wipe out target shell use
multifire() clobbered any changes to the target ship or sector made by
defend().  This let the target fire back for free.

multifire() retreated the target ship before reporting its location to
the player.  This disclosed its new location.

Fix by damaging and retreating the target after calling defend().
2008-05-05 06:53:33 +02:00
aae77430bf Change fire to always fire guns when the target is beyond range
multifire() drops depth charges if the target is a submarine, else it
fires guns.  It fails if the target is out of range.  But players
could still find out whether the target is a sub then, because depth
charge shell use differs from gun fire shell use.  This loophole
existed before 4.0.6, and was reopened by commit a3ad623b (v4.3.12).

Change multifire() to always use guns if the target is out of range.

While there, treat failure from shp_dchrg() and shp_fire() the same,
so that the player can't distinguish the two cases.  Failure there
should not happen.
2008-05-05 06:52:15 +02:00
cd6d12c4fb Make depth charges work with just one shell
Commit a3ad623b (v4.3.12) made depth charging fail when there's just
one shell.  This let players find all submarine uids.  It basically
reopened the loophole closed in commit aa26c53e (v4.2.20).

Fix by making shp_dchrg() with just one shell succeed and return
damage like fire from one gun.
2008-05-04 19:27:31 +02:00
66165f34cb Fix fire command to detect when the firing object changes
multifire() failed to take into account that the firing firing sector,
ship or land unit can change while it is getting the target argument.
It thus clobbered any updates made to the firing object while it was
sleeping for the target argument.  Abusable.  Broken when Chainsaw
introduced MULTIFIRE.
2008-05-04 16:44:26 +02:00
bf2fd6cb82 Fix parsing of anchor-relative time in update schedule
Commit 16b811d4 (v4.3.13) broke parse_time().
2008-05-04 09:52:46 +02:00
e8f82d34a7 Update change log again for 4.3.14. 2008-04-29 22:08:03 +02:00
a433320125 Journal input of special cookies "ctld" and "aborted"
The latter is necessary to interpret the journal correctly.  The
former isn't, as it should always lead to a logout straight away, but
treating it just the same is simple and doesn't hurt.
2008-04-29 21:42:17 +02:00
f3202225f2 Rewrite recvclient() for clarity
Behavior differs for the following scenario: if, while the thread
sleeps in io_input() called from recvclient(), at least one line of
input arrives and the thread gets awakened by the update aborting
commands, then the old code throws away the first line of input, but
the new code doesn't.
2008-04-29 21:35:02 +02:00
8209b88a54 Fix launch not to report the same ship sunk twice
This happened when a marine missile with a conventional warhead sunk
its target.
2008-04-29 21:10:33 +02:00
c539820350 Oops on nuclear-tipped anti-sat missiles
Anti-sat code is not prepared to deal with nuclear damage.  The arm
command refuses to arm anti-sats, but better check.
2008-04-29 21:01:54 +02:00
7bc63871c6 Fix bugs in tracking of planes flying a sortie
Commit 7ca4f412 fixed tracking of planes flying a sortie by marking
them with flag PLN_LAUNCHED.  It failed to write SAMs and planes
flying missions back to the plane file, in sam_intercept() and
mission_pln_arm().  The only known problem with that is fairly
harmless: when the mission damages planes on the ground, the planes
flying it get damaged as if they were still sitting in their bases,
but the damage gets wiped out when they land.

The same issue applies to missiles.  So they need to be tracked as
well.  Do that in msl_hit().

While there, remove a few redundant PLN_LAUNCHED sanity checks.
2008-04-29 20:53:35 +02:00
4e9e58bf6a Write planes fixed on game start to disk properly
When fixing planes stuck in the air, we fixed them only in memory, so
when a fixed plane wasn't written to disk for other reasons before the
next game start, it had to be fixed again.

Change pln_zap_transient_flags() to write them out.
2008-04-29 20:38:10 +02:00
dd0e0423ee Don't let hardened missiles be loaded on ships or land units
Fix load_plane_ship() and load_plane_land() to reject hardened planes.
2008-04-28 22:30:19 +02:00
1d0f4b3071 Don't let missiles loaded on land units be hardened
hard() already rejected missiles loaded on ships, but missed land
units.
2008-04-28 22:27:54 +02:00
4f40ea04d8 Document what happens when the update aborts commands 2008-04-28 22:24:36 +02:00
c66e8319ee Revert "(prmptrd, uprmptrd): Should not be called while player->aborted. Check."
This reverts commit fee8ac9d8f.

These *are* called while player->aborted.  Could be avoided, but: the
reason for not wanting to prompt then is to have each prompt consume a
line of input.  That's actually not feasible, because when we wait for
an argument (after prompting for it) when the update aborts commands,
we can't consume the argument we prompted for.
2008-04-28 22:22:18 +02:00
61998d2316 Fix lnd_fire() ammo sanity check
Checking l_ammo before lnd_dam() oopses when something attempts to
fire from a land unit type that can't fire (l_dam == 0) and uses no
ammo.  Such usage is perfectly fine.  Move the check to the correct
place.
2008-04-26 10:15:05 +02:00
9e19123abf Update change log for 4.3.14 2008-04-25 22:28:40 +02:00
32d6c5e1b7 A script for post_crash_dump_hook 2008-04-25 22:13:08 +02:00
f63401329d New post_crash_dump_hook
Run it from crash_dump().  Useful to move core files out of the way,
alert deities by e-mail, and so forth.
2008-04-25 22:12:22 +02:00
dd0737f8e7 Detect and log errors in crash_dump() 2008-04-25 22:09:52 +02:00
f55860670a Move oops actions from log.c up to application
Change oops() to call the new oops_handler function pointer instead of
offering a fixed set of actions.  Change server's main() to install a
handler for the action requested by -E.
2008-04-25 22:06:13 +02:00
6709931d51 Give try_supply_commod() internal linkage 2008-04-22 21:56:35 +02:00
627e7d452d New server option -E to choose what to do on oops
Three options: abort, crash-dump, nothing.  crash-dump works by
aborting a fork.  It isn't implemented for Windows.

The oops action is no longer tied to daemon mode, but -d still implies
-E abort for convenience.
2008-04-21 21:52:27 +02:00
beb8a7ceb4 Flush every journal entry even when not in debug mode
Somewhat wasteful, but useful in case of a crash.
2008-04-21 20:42:50 +02:00
b1a0ff2fbd Don't let trains load trains
Doesn't affect the stock game, because its only train is heavy.
2008-04-20 15:11:15 +02:00
Ron Koenderink
aab015c641 Allow deity to display power report for all types of countries
Relax country status check of power c for deities.  Can be useful to
display NPCs.
2008-04-20 15:11:09 +02:00
66406bd240 Fix designate's check for disallowed sector types
Bug lets mortals designate all sector types, including sanctuaries.
desi() complains, but then executes anyway.  Broken in commit
8227d8c8, v4.3.12.
2008-04-16 07:45:07 +02:00
9272c47c9f Bump version to 4.3.14 2008-04-16 07:38:39 +02:00
fa98d40e86 Final polish for 4.3.13 2008-04-15 21:04:03 +02:00
2d4e4e0d96 Fix documented syntax of edit command.
While there: editing nukes isn't implemented, don't advertise it.
2008-04-15 20:57:28 +02:00
b88d59b9e4 Document that nukes can be traded 2008-04-15 20:56:07 +02:00
ba628b82bd Fix and polish comments emitted by pconfig 2008-04-15 20:29:29 +02:00
ae2a8097b8 4.3.13 late changes 2008-04-11 22:12:41 +02:00
afb642b38d Wrap long lines in version's list of customized tables
Factor the wrapping print out of show_opts() into prwrap().  Use it
in show_custom().
2008-04-10 22:01:25 +02:00
16b811d4ac Work around strptime() lossage
Some losing implementations of strptime() such as FreeBSD's happily
succeed when they fully consumed the first argument, regardless of
whether they matched the full second argument or not.  This causes
lines without directives to be interpreted as "next Sunday".

Work around the lossage in parse_time().
2008-04-07 20:20:13 +02:00
Ron Koenderink
6942ea94dd Fix emp_server manual page synopsis for Windows
The -R option appears in the wrong place.
2008-04-07 08:30:43 +02:00
41cd0f0fe6 Bump client version to 4.3.13
This was forgotten in commit ef00d650 and commit 09c21f83.  The 4.2.12
client misidentified itself as 4.2.11.
2008-04-06 22:07:02 +02:00
8e354e56c0 Update change log for 4.3.13 2008-04-06 22:00:25 +02:00
a291e6dd23 Belatedly update c_form of xdump command
Update for commit da8a1dae, v4.3.12.
2008-04-06 21:52:33 +02:00
4f5e2119c6 Put MAXNOC in xdump version
Create virtual selector nsc_ver_maxnoc() for it.
2008-04-06 15:03:37 +02:00
2725d6e736 Doc fix: don't claim empdump doesn't exist yet 2008-04-06 14:48:12 +02:00
7a0252e40a Fix initialization of realms in newcap
Broken in commit e1a68c72, v4.3.12.
2008-04-06 09:49:47 +02:00
793cc220ec Fix add of for status arguments active, god, delete
Broken in commit e1a68c72, v4.3.12.
2008-04-06 09:18:56 +02:00
ef00d65051 Bump version to 4.3.13 2008-04-06 09:18:51 +02:00
01106d3024 Remove unused unit stat development macros
Commit 0219bf08 hid all of them them away, but used only some of them
in their new home.  Clean up.
2008-04-04 20:35:09 +02:00
b47617004a Update change log for 4.3.12 2008-04-02 07:36:47 +02:00
1f9e884525 Don't make more babies than food permits
babies() rounded the maximum number of babies permitted by food.  When
this rounded up, grow_people() could use more food than available, and
the sector's food could become negative.  Fix by always rounding down.
2008-04-01 20:05:10 +02:00