Markus Armbruster [Wed, 7 Apr 2010 21:35:25 +0000 (23:35 +0200)]
Fix test for capability engineer in lnd_hit_mine()
Bogus array index, unpredictable result, can crash the server. Broken
in commit
ef7ea893, v4.3.24.
(cherry picked from commit
7506039f1b31eeaddab436831d23fb50c2f9409b)
Markus Armbruster [Sun, 21 Mar 2010 08:26:37 +0000 (09:26 +0100)]
Fix test for capability sweep in shp_hit_mine()
Bogus array index, unpredictable result, can crash the server. Broken
in commit
ef7ea893, v4.3.24.
(cherry picked from commit
054eba7a1d5f92d80ac340787cb8d7798a20ec1e)
Markus Armbruster [Sat, 20 Mar 2010 16:55:56 +0000 (17:55 +0100)]
Fix interdiction not to wipe out target ship updates
Ships can expend shells to defend against missiles, in
shp_missile_defense(). Any shell use by the target ship got wiped out
when shp_missile_interdiction() wrote back the target ship, triggering
a seqno mismatch oops.
Ships get updated when they launch planes to intercept interdicting
planes, in mission_pln_equip(). Any petrol use by the target ship got
wiped out when shp_mission_interdiction() wrote back the target ship,
triggering a seqno mismatch oops.
Fix by re-reading the target ship in shp_damage_one(). This also
affects shp_fort_interdiction(), where it is not necessary. A bit
inefficient, but let's keep this fix simple.
(cherry picked from commit
1d4fea32b845686163b9be79e21ca7ea279357e1)
Markus Armbruster [Sat, 13 Mar 2010 21:47:13 +0000 (22:47 +0100)]
Fix navigate and march not to lay mines free of charge
do_unit_move() reads the ships into a list. It re-reads them when it
prompts for sub-commands. shp_nav_one_sector() writes them back when
it moves ships.
Mine-laying (sub-command 'd') updates the minelayer, invalidating the
copy in the list. Any movement sub-command before the next prompt for
sub-commands wiped out this update, triggering a seno mismatch oops.
Happens only if 'd' is used without arguments, because remaining
sub-commands are discarded when there are arguments.
Broken when mine-laying was added in commits
2438fe7c, v4.3.7.
Same for march, commit
274c8e42, v4.3.7.
Fix by stopping after 'd' regardless of arguments.
(cherry picked from commit
28cc236e1264d57a06dfb89cf43a600ba88d271c)
Markus Armbruster [Sat, 20 Mar 2010 10:24:49 +0000 (11:24 +0100)]
Fix navigate and march not to prompt for number of mines to lay
When sub-command 'd' was used without arguments, do_unit_move() failed
to supply the second argument to mine(), which duly prompted for it.
This contracticted info, and could trigger a generation oops.
do_unit_move() reads the ships into a list. It re-reads them when it
prompts for sub-commands. shp_nav_one_sector() writes them back when
it moves ships.
The mine prompt made the list stale. Movement sub-commands before the
next prompt for sub-commands wrote back stale ships, triggering a
generation oops. Example: "nav 15 dg".
Broken when mine-laying was added in commits
2438fe7c, v4.3.7.
Same for march, commit
274c8e42, v4.3.7.
(cherry picked from commit
45106ab91ffe6193bc90a725e8a07a7a3997f54c)
Markus Armbruster [Sat, 13 Mar 2010 12:49:36 +0000 (13:49 +0100)]
Nuclear-tipped missile exploding on launch could not damage base
Commit
a269cdd7 (v4.3.23) removed the nuclear damage. But it left the
nuke on the missile, which made pln_damage() oops and return zero
damage.
Fix by destroying the nuke separately.
(cherry picked from commit
876f3424b0bb28efab505722d89b34395ad43ae6)
Markus Armbruster [Fri, 12 Mar 2010 19:39:39 +0000 (20:39 +0100)]
Fix news for torpedo attack's return torpedo
When a torpedo attack triggered a return torpedo, the news reported it
to be fired by the attacker instead of the defender.
(cherry picked from commit
bb5abd95e0af72cded1940b2fd9885dca2a465cb)
Markus Armbruster [Wed, 10 Mar 2010 07:54:06 +0000 (08:54 +0100)]
Interdiction attacked submarines with surface-only weapons
shp_mission_interdiction() used MI_INTERDICT instead of MI_SINTERDICT.
Broken in commit
cd8fe31e, v4.3.24.
(cherry picked from commit
2dd97dbd00202643f4c61ba4e6aceb1eecd7797a)
Markus Armbruster [Thu, 25 Feb 2010 06:07:28 +0000 (07:07 +0100)]
Fix unsafe use of shared buffers in commands drawing maps
Maps are generally drawn into static scratch buffers. Each command
has its own buffers.
Static scratch buffers are safe as long as they're never used across
yields. Player output can yield unless the command has flag C_MOD
set. Commands lradar, path, radar, route, satellite, sect, survey
hadn't. If such a command yields while using scratch buffers, another
instance of the command can clobber them.
Abuse seems tricky, but possible: if a malicious player stalls output
just right, a command yields while printing a map from the scratch
buffer. It resumes only when the malicious player reads some output.
If another player runs the same command before that, it overwrites the
same static scratch buffer with its map. The malicious player
receives the last such run's map.
4.2.8 fixed the same bug for bmap, lbmap, lmap, map, nmap, pbmap,
pmap, sbmap and smap.
All were broken in 4.2.0. Except radar maps (lradar and radar) were
already broken in Empire 2 for AIX.
(cherry picked from commit
8bdb5c5c1b5a672a280664b798687adc158fe3f7)
Markus Armbruster [Sun, 21 Feb 2010 17:44:16 +0000 (18:44 +0100)]
Generation numbers didn't catch all potential yields on output
io_output_if_queue_long() called ef_make_stale() only for long queues.
Missed in commit
2fa5f652, v4.3.24.
(cherry picked from commit
a38c47a22c63b0e31874138548e45b58bfb636bf)
Markus Armbruster [Sat, 6 Feb 2010 20:36:21 +0000 (21:36 +0100)]
Change fairland not to reject small worlds without trying
Instead, print a warning and try. It may well work, and when it
doesn't, it fails cleanly.
(cherry picked from commit
de81e4e20a40489fa2074060b4220ebb761025c8)
Markus Armbruster [Sun, 10 Jan 2010 11:31:44 +0000 (12:31 +0100)]
Document fortress maintenance cost in info Hvy-Plastic
Markus Armbruster [Sun, 10 Jan 2010 11:28:44 +0000 (12:28 +0100)]
Update game name and URL for Hvy Plastic 2 in info Hvy-Plastic
Markus Armbruster [Mon, 16 Mar 2009 18:50:08 +0000 (19:50 +0100)]
Document server time in info Hvy-Plastic
Markus Armbruster [Mon, 23 Feb 2009 20:56:49 +0000 (21:56 +0100)]
New info Hvy-Plastic
Markus Armbruster [Mon, 9 Mar 2009 20:22:03 +0000 (21:22 +0100)]
Change fairland island size probability distribution
Island size is randomly chosen from the interval [1..2*is+1], with
expected value is. Use two dice to roll the size instead of one.
This makes extreme sizes much less likely.
Markus Armbruster [Sat, 5 Apr 2008 14:09:24 +0000 (16:09 +0200)]
Make fairland record the island number in the deity territory
Can be useful for deities when further customizing their game setup.
Markus Armbruster [Tue, 17 Mar 2009 19:19:49 +0000 (20:19 +0100)]
Fix recipient thread in output journal
Output journaling was cherry-picked from Hvy Metal II. However, how
threads are identified in the journal changed since then.
journal_output_1() needs updating for that.
Markus Armbruster [Sat, 2 Aug 2008 13:04:16 +0000 (09:04 -0400)]
Fix journalling of output ids
Markus Armbruster [Wed, 30 Jul 2008 12:26:34 +0000 (08:26 -0400)]
Journal output lines instead of chunks
Output often arrives in chunks other than lines. Hard to read in the
journal. Delay journalling until we got a full line or our buffer is
exhausted. This is less precise, but it'll do for now.
Markus Armbruster [Wed, 30 Jul 2008 00:38:48 +0000 (20:38 -0400)]
New journal event output
To enable, set econfig key keep_journal to at least 2. Output events
are *not* flushed to disk immediately.
Put it in Hvy Metal II now to gather real data for future testing of a
journal replay tool.
Markus Armbruster [Tue, 29 Jul 2008 11:48:28 +0000 (07:48 -0400)]
New journal event command
Redundant information, but makes the journal easier to read. The
redundancy might help making a journal replay tool robust.
Put it in Hvy Metal II now to gather some real data.
Markus Armbruster [Tue, 26 Jan 2010 21:30:24 +0000 (22:30 +0100)]
Update change log again for 4.3.24
Markus Armbruster [Tue, 26 Jan 2010 21:20:16 +0000 (22:20 +0100)]
Fix generation numbers for order command
orde() uses a "clever" trick to get away with just one
check_ship_ok(): it makes a copy of the ship in the beginning, and
checks it at the end. Generation numbers (commit
2fa5f652) break this
trick. It could be fixed by manually marking the ship fresh.
Instead, check the ship the stupid, straightforward way, without a
copy.
Markus Armbruster [Tue, 26 Jan 2010 21:02:34 +0000 (22:02 +0100)]
Normalize order's reaction to bad input
Consistently fail the command on bad or missing argument. Before, it
merely skipped to the next ship in some cases.
Markus Armbruster [Tue, 26 Jan 2010 20:48:26 +0000 (21:48 +0100)]
Get third argument of "order l" the ordinary way
Now prompts when the argument is empty. Before, that was interpreted
as zero. Not likely to affect players.
Markus Armbruster [Tue, 26 Jan 2010 20:23:10 +0000 (21:23 +0100)]
Clean up dead code in orde()
Does not change optimized code (gcc -O) apart from __LINE__.
Ron Koenderink [Mon, 25 Jan 2010 02:45:51 +0000 (20:45 -0600)]
Fix windows client not always exiting
The call to WSAEnumNetworkEvents() was reseting network
events in particular WSAECONNRESET was sometimes being lost
causing the client to not exit. The WSAEnumNetworkEvents()
was called from fd_is_socket() and has been replace with
getsockopt() to determine if the fd is socket or not.
Broken in commit
4d40a275, v4.3.23
Markus Armbruster [Mon, 18 Jan 2010 18:35:37 +0000 (19:35 +0100)]
Update change log for 4.3.24
Markus Armbruster [Sat, 16 Jan 2010 16:40:28 +0000 (17:40 +0100)]
Clean up dead stores
Does not change optimized code (gcc -O).
Spotted by the Clang Static Analyzer.
Markus Armbruster [Sat, 16 Jan 2010 16:15:22 +0000 (17:15 +0100)]
Fix navigate/march crash on funny path arguments
For an argument consisting of a valid path plus whitespace,
do_unit_move() eventually passed the whitespace suffix to parse(),
then dereferenced player->argp[0]. But that was null.
Broken in commit
0c12d837, v4.3.7. Trivial for players to trigger.
Markus Armbruster [Sat, 16 Jan 2010 15:29:41 +0000 (16:29 +0100)]
Fix player_login() not to print null pointer
When the input line contains only whitespace, player->argp[0] is null
after parse(). This condition was not checked, comtch() returned
M_IGNORE, and code handling that printed the null pointer. Some
systems (GNU, Windows) deal gracefully with printing null strings,
others crash. Trivial to trigger remotely.
Before the fix, the value of parse() was assigned, but never used, and
that was spotted by the Clang Static Analyzer.
Markus Armbruster [Sat, 16 Jan 2010 09:14:43 +0000 (10:14 +0100)]
Clean up useless getnatp() in conv(), nav_map(), tele()
Spotted by the Clang Static Analyzer.
Markus Armbruster [Sat, 16 Jan 2010 08:31:08 +0000 (09:31 +0100)]
Move -h to the end of the emp_server -h output
This is consistent with the other programs.
Markus Armbruster [Sat, 16 Jan 2010 08:29:53 +0000 (09:29 +0100)]
Make empire, empsched and files catch extra operands
This also avoids a dead increment ap++ in src/client/main.c reported
by the Clang Static Analyzer.
Markus Armbruster [Sat, 16 Jan 2010 08:22:48 +0000 (09:22 +0100)]
Make empire and files not print usage on bad option
Point to -h instead. This is consistent with the other programs.
Markus Armbruster [Fri, 15 Jan 2010 21:06:51 +0000 (22:06 +0100)]
Fix lwpReschedule()'s assertion "have runnable thread"
If there is no runnable thread, we're deadlocked. lwpReschedule() has
an assertion to catch this. But it didn't work, and the code
following it would crash then. Can't actually happen, because the
EventHandler thread is always runnable. Spotted by the Clang Static
Analyzer.
Markus Armbruster [Fri, 15 Jan 2010 19:20:36 +0000 (20:20 +0100)]
Declare cant_listen() noreturn
Local analysis can now easily find out what's up. Before, inter-
procedural analysis was required. The Clang Static Analyzer
complained about a dereference of res that is actually fine.
Markus Armbruster [Fri, 15 Jan 2010 19:02:11 +0000 (20:02 +0100)]
Make CANT_HAPPEN() more obvious for static analysis
Local analysis can now easily find out what's up. Before,
whole-program analysis was required. The Clang Static Analyzer
complained about code that is actually fine.
Markus Armbruster [Thu, 14 Jan 2010 21:39:42 +0000 (22:39 +0100)]
Fix getpath() not to crash when path exceeds MAX_PATH_LEN
Trivial for players to trigger. Broken in commit
0b0612ea, v4.3.16.
Spotted by the Clang Static Analyzer.
Markus Armbruster [Wed, 13 Jan 2010 20:21:58 +0000 (21:21 +0100)]
Fix oops on escort, recon, and launch of satellite
Broken in commit
528df9ac, v4.3.23. pln_equip() recovered fine.
Markus Armbruster [Sun, 10 Jan 2010 07:53:25 +0000 (08:53 +0100)]
Update copyright notice
Markus Armbruster [Sun, 10 Jan 2010 07:47:40 +0000 (08:47 +0100)]
Fix trailing whitespace
Markus Armbruster [Sat, 9 Jan 2010 15:21:40 +0000 (16:21 +0100)]
Stop ship and land unit movement on interdiction with no damage
Movement stops when shp_interdict() or lnd_interdict() report
interdiction. However, they reported it only when there was
interdiction damage.
Zero interdiction damage commonly happens when interdicting missiles
miss, or all bombers abort. Stopping regardless of damage makes more
sense there.
Moreover, not stopping is buggy: do_unit_move() needs to take care not
to wipe out updates made by interdiction to the moving ships or land
units. It does so only when it stops. Updates made by interdiction
without interdiction damage could get wiped out, triggering a seqno
mismatch oops.
Known ways moving ships and land units can get updated by interdiction
despite there is no interdiction damage:
* Interdicting bombers get intercepted by planes based on a navigating
carrier, carrier gets charged petrol. The bug wipes out the petrol
use.
* Marching land units get interdicted by planes, but all planes miss.
Sufficiently large collateral damage to the sector can still damage
the land units. The bug wipes out the damage to land units.
To make shp_interdict() and lnd_interdict() report interdiction
regardless of damage, change lnd_missile_interdiction(),
lnd_fort_interdiction(), lnd_mission_interdiction(),
shp_missile_interdiction(), shp_fort_interdiction(),
shp_mission_interdiction() to return whether there was interdiction.
Before, they returned whether there was damage.
Change unit_interdict(), perform_mission(), perform_mission_land(),
perform_mission_ship(), perform_mission_msl(), and
perform_mission_bomb() to return -1 for no interdiction, so that
callers can distinguish no interdiction from interdiction with no
damage.
Markus Armbruster [Sat, 9 Jan 2010 13:51:59 +0000 (14:51 +0100)]
Clean up poorly chosen loop control variable names
Calling a counting loop's control variable q or z is tasteless
bordering on actively misleading.
Markus Armbruster [Sat, 9 Jan 2010 13:22:51 +0000 (14:22 +0100)]
Simplify perform_mission()
Markus Armbruster [Sat, 9 Jan 2010 12:49:34 +0000 (13:49 +0100)]
Remove struct genlist member cp
Markus Armbruster [Sat, 9 Jan 2010 12:46:33 +0000 (13:46 +0100)]
Remove perform_mission_land(), perform_mission_ship() parameter md
Markus Armbruster [Sat, 9 Jan 2010 12:26:16 +0000 (13:26 +0100)]
Split up perform_mission()
Move code out of perform_mission() into new perform_mission_land(),
perform_mission_ship(), perform_mission_msl(), perform_mission_bomb().
Markus Armbruster [Sat, 9 Jan 2010 08:44:12 +0000 (09:44 +0100)]
Make lnd_mission_interdiction() apply damage
To make lnd_mission_interdiction() work just like
shp_mission_interdiction().
Markus Armbruster [Sat, 9 Jan 2010 08:40:01 +0000 (09:40 +0100)]
New lnd_mission_interdiction()
Factored out of lnd_interdict(). No functional change.
Markus Armbruster [Sat, 9 Jan 2010 08:39:15 +0000 (09:39 +0100)]
New shp_mission_interdiction()
Factored out of shp_interdict(). No functional change.
Markus Armbruster [Sat, 2 Jan 2010 08:27:55 +0000 (09:27 +0100)]
Fix att_reacting_units() to initialize ulist member eff
This left initial eff at zero. No effect, because its only user
get_land() ignores efficiency increases.
Markus Armbruster [Sat, 2 Jan 2010 08:14:55 +0000 (09:14 +0100)]
Simplify ask_olist and get_dlist() not to re-read land units
getland() is obviously redundant in get_dlist(), because the land unit
can't have changed since the previous read.
What's up with ask_olist() is less obvious. For each capable land
unit, ask_olist() asks the player whether to attack with it. If it
attacks, it gets copied into olist. Since asking the player yields
the processor, these copies can become stale. However, re-reading
fixes that just for the last one. Moreover, the code copes with stale
copies just fine: ask_olist() is always directly followed by
att_get_offense() or att_move_in_off(), and both replace the
potentially stale copy in olist.
Markus Armbruster [Sun, 3 Jan 2010 20:45:10 +0000 (21:45 +0100)]
Remove get_land() parameter uid
For all remaining calls, the uid can be obtained from parameter llp.
Markus Armbruster [Sat, 2 Jan 2010 07:53:25 +0000 (08:53 +0100)]
Inline get_land()'s "first time" case into its callers
ask_olist() and get_dlist() called get_land() with llp->chrp still
null, which made it initialize parts of llp instead of performing its
usual integrity check. att_reacting_units() had the initialization
inline. Change the other two to match, and simplify get_land(). No
functional change.
Markus Armbruster [Fri, 1 Jan 2010 15:55:24 +0000 (16:55 +0100)]
Drop last parameter of shp_hit_mine() and lnd_hit_mine()
Markus Armbruster [Fri, 1 Jan 2010 15:38:47 +0000 (16:38 +0100)]
Simplify use of shp_missile_interdiction()
shp_missile_interdiction() does nothing when there are no suitable
targets. Its users avoid to call it when there are none, probably to
save a few cycles. Optimize shp_missile_interdiction() for that case,
and simplify the callers.
Markus Armbruster [Fri, 1 Jan 2010 10:15:51 +0000 (11:15 +0100)]
Make empdump call ef_close() regardless of -n
Avoiding ef_close() with -n is not necessary, so don't.
Markus Armbruster [Thu, 31 Dec 2009 10:50:22 +0000 (11:50 +0100)]
Rearrange struct sctstr slightly to expose commonalities with units
Nice bonus: space needed for sectors shrinks some 4%. Size of game
state could shrink perhaps 1-2%.
Markus Armbruster [Thu, 31 Dec 2009 10:39:17 +0000 (11:39 +0100)]
Narrow struct sctstr member sct_mobil to char
To bring it in line with unit mobility.
Markus Armbruster [Thu, 31 Dec 2009 10:36:59 +0000 (11:36 +0100)]
Make struct sctstr member sct_effic signed
To bring it in line with unit efficiency.
Markus Armbruster [Thu, 31 Dec 2009 10:33:06 +0000 (11:33 +0100)]
Streamline fortgun()'s efficiency comparison
Use >= 60 instead of > 59, for consistency with similar comparisons
elsewhere.
Markus Armbruster [Thu, 31 Dec 2009 10:27:48 +0000 (11:27 +0100)]
Fix sloppy sanity check for mobility going negative in transport
Assignment to sct_mobil was vulnerable to integer underflow. Should
not happen, as move_ground() never returns a cost exceeding available
mobility.
Markus Armbruster [Thu, 31 Dec 2009 12:14:36 +0000 (13:14 +0100)]
Generation numbers to catch write back of stale copies
Oops when a stale copy is written back, i.e. the processor was yielded
since the copy was made. Such bugs are difficult to spot. Sequence
numbers catch them when they do actual harm (they also catch different
bugs). Generation numbers catch them even when they don't.
New ef_generation to count generations. Call new ef_make_stale() to
increment it whenever the processor may be yielded.
New struct emptypedstr member generation. To conserve space, make it
a bit-field of twelve bits, i.e. generations are only recorded modulo
2^12. Make sure all members of unit empobj_storage share it. It is
only used in copies; its value on disk and in the cache is
meaningless. Copies with generation other than ef_generation are
stale. Stale copies that are a multiple of 2^12 generations old can't
be detected, but that is sufficiently improbable.
Set generation to ef_generation by calling new ef_mark_fresh() when
making copies in ef_read() and ef_blank(). nav_ship() and
fltp_to_list() make copies without going through ef_read(), and
therefore need to call ef_mark_fresh() as well. Also call it in
obj_changed() to make check_sect_ok() & friends freshen their argument
when it is unchanged.
New must_be_fresh() oopses when its argument is stale. Call it in
ef_write() to catch write back of stale copies.
Markus Armbruster [Thu, 31 Dec 2009 09:30:54 +0000 (10:30 +0100)]
Store sequence numbers more compactly
Store them and ef_type in bit-fields.
Allocate eight bits for ef_type. Values range from 0 to EF_GAME
(currently 16), so this is plenty.
Allocate twelve bits for sequence numbers. Sequence number mismatches
are now missed when the numbers are equal modulo 2^12. Still
sufficiently improbable.
Common machines store the bit-fields in a 32 bit word. There are
twelve bits left in that word for future use. Total savings 16 bits,
which is exactly what the previous commit spent on wider uids on
common machines.
Markus Armbruster [Wed, 30 Dec 2009 13:07:51 +0000 (14:07 +0100)]
Store uids as int to support more sectors and units
Before, they were stored as short. Wider uids use more space, but the
next commit will recover it by narrowing other members.
The use of short has always limited the number of ships, planes, land
units and nukes to SHRT_MAX (commonly 32768). Only the most extreme
games ever came close.
Commit
49780e2c (v4.3.12) added struct sctstr member sct_uid to make
struct empobj member uid work for sectors. This made the limit apply
to sectors as well. We've had games with more than 32768 sectors.
Markus Armbruster [Thu, 31 Dec 2009 11:12:39 +0000 (12:12 +0100)]
Fix new_seqno()'s recovery from seqno mismatch
A sequence number mismatch occurs when an invalid copy (with a stale
sequence number) gets written. To continue after the error, we need
to use the current sequence number. But new_seqno() used the larger
one of the two, which is correct only as long as sequence numbers do
not overflow. Overflow is rather unlikely, though.
Markus Armbruster [Thu, 31 Dec 2009 08:18:37 +0000 (09:18 +0100)]
Record news more compactly
Member nws_uid is unused since the commit before previous. Remove it.
Member nws_seqno is of marginal value, because we write news only
through ncache[], and thus aren't prone to the errors sequence numbers
can catch. Remove it.
Make timestamp selector virtual, computing nws_when + nws_duration,
and remove member nws_timestamp. Impact:
* In ncache(), the removed timestamp equals nws_when + nws_duration,
both for new news and updated news. No change.
* delete_old_news() becomes invisible. Before, its move of unexpired
news to the beginning of the news file touched all the timestamps.
That was unwanted, because the move does not change news, only their
storage. Improvement.
* empdump no longer flags the imported news changed via the timestamp.
This is somewhat unfortunate. Document as bug.
With these members removed, struct nwsstr no longer matches struct
emptypedstr, so clear news table flag EFF_TYPED and remove union
empobj_storage member news. This loses the automatic maintenance of
member ef_type via struct emptypedstr. Remove ef_type as well.
This shrinks struct nwsstr from 20 to 12 bytes on common 32 bit
machines, and from 32 to 16 bytes on common 64 bit machines. Since
the server doesn't map the whole news file (EFF_MAP is off), this
reduces I/O, while the table's memory use remains the same.
Historical note: struct nwsstr is now pretty much what it was back in
BSD Empire 1.1. Members ef_type and nws_uid go back to Empire 3 (for
C_SYNC?). v4.3.12 added member nws_timestamp, which doubled the size
on common 64 bit machines. v4.3.15 added nws_seqno.
Markus Armbruster [Thu, 31 Dec 2009 08:17:54 +0000 (09:17 +0100)]
New news selector duration
Backed by new struct nwsstr member nws_duration. Time between first
and last occurence of the news recorded in this item, in seconds.
Markus Armbruster [Thu, 31 Dec 2009 06:36:47 +0000 (07:36 +0100)]
Revert "Get rid of struct newscache"
This reverts commit
832574b6dee87f4efb56945c62e5d2fadec27288.
To prepare for removal of struct nwsstr member nws_uid.
Conflicts:
src/lib/subs/nreport.c
Markus Armbruster [Wed, 30 Dec 2009 12:49:41 +0000 (13:49 +0100)]
Remove unused members of struct lndstr, lonstr, nukstr, trtstr
struct lndstr member lnd_flags is a leftover from Empire3's C_SYNC,
which was ripped out in 4.0.0.
struct lonstr member l_sel, struct nuk_str members nuk_ship, nuk_land,
and struct trtstr member trt_bond have been there basically forever
without any use.
Markus Armbruster [Wed, 30 Dec 2009 11:44:01 +0000 (12:44 +0100)]
Consistently use int for sector and unit uid parameters
Markus Armbruster [Tue, 29 Dec 2009 12:09:01 +0000 (13:09 +0100)]
Consistently use int for file type parameters and locals
Markus Armbruster [Tue, 29 Dec 2009 12:06:35 +0000 (13:06 +0100)]
Consistently use int for mission type parameters
Markus Armbruster [Sat, 26 Dec 2009 13:02:50 +0000 (14:02 +0100)]
Fix launch not to wipe out target sector updates
Launching ABMs updates their base, in mission_pln_equip(). The update
got wiped out when launch_missile() wrote back the target sector,
triggering a seqno mismatch oops. Harmless with the stock game's
ABMs, because they use neither shells nor petrol.
Fix by re-reading the target sector.
Markus Armbruster [Sat, 26 Dec 2009 10:28:25 +0000 (11:28 +0100)]
Fix launch not to wipe out target ship updates
Ships can expend shells to defend against missiles, in
shp_missile_defense(). Any shell use by the target ship got wiped out
when launch_missile() wrote back the target ship, triggering a seqno
mismatch oops.
Fix by re-reading the target ship.
Markus Armbruster [Sat, 26 Dec 2009 09:20:21 +0000 (10:20 +0100)]
Bump version to 4.3.24
Markus Armbruster [Mon, 14 Dec 2009 05:56:23 +0000 (06:56 +0100)]
Fix nightly build
Commit
5f89f8cb added pre_update.econfig with incorrect permissions.
Markus Armbruster [Sun, 13 Dec 2009 16:37:13 +0000 (17:37 +0100)]
Update change log for 4.3.23
Markus Armbruster [Sun, 13 Dec 2009 14:10:07 +0000 (15:10 +0100)]
Update known contributors comments
Markus Armbruster [Sun, 13 Dec 2009 07:58:07 +0000 (08:58 +0100)]
Belatedly update make dependencies for standalone client build
main.$O was out of date since commit
518c8d6f.
Ron J Koenderink [Fri, 4 Dec 2009 02:21:22 +0000 (20:21 -0600)]
Don't patch constants.c for nightly, use econfig
Markus Armbruster [Wed, 14 Oct 2009 23:19:00 +0000 (19:19 -0400)]
Fix info navigate on missile interdiction targets
Missile interdiction targets only "valuable" ships since Empire 3.
Markus Armbruster [Wed, 14 Oct 2009 23:10:48 +0000 (19:10 -0400)]
Fix info Mobility not to claim missions get a bonus
Bonus was dropped in v4.0.0.
Markus Armbruster [Wed, 14 Oct 2009 00:19:39 +0000 (20:19 -0400)]
Make transport chopper not light
Capability light has no effect for choppers since commit
041ad4ce,
v4.3.11.
Markus Armbruster [Mon, 12 Oct 2009 02:32:44 +0000 (22:32 -0400)]
Fix messages in msl_launch()
Markus Armbruster [Mon, 12 Oct 2009 02:18:26 +0000 (22:18 -0400)]
Don't intercept tactical and marine missiles targeting planes
Missiles attacking ground targets (sectors, ships or land units) can
be intercepted, missiles targeting planes can't. Except msl_launch()
checked the missile's capabilities instead of its target, and thus
intercepted missiles that *could* target ground even when they
targeted planes.
This broke the missile interception code's assumption that
interceptors aren't intercepted, and crashed the server through
infinite recursion: tactical abm #1 intercepts, tactical abm #2
intercepts #1, #1 intercepts #2, ...
Same bug in msl_hit() printed "incoming missile" for missiles that
could target ground but do target planes.
Broken in Empire 2. Bug can't bite with the stock game's planes.
Markus Armbruster [Sun, 11 Oct 2009 16:04:16 +0000 (12:04 -0400)]
Fix and enable collateral damage for missing missiles
Collateral damage was disabled, because after msl_hit() reported a
miss, the missile may or may not have reached the target.
Fix by splitting msl_launch() off msl_hit().
Drop the disabled collateral damage code for sector targets, because
sectors can't be missed. Enable it for ships and land units.
Since msl_launch() returns whether the missile is sub-launched, drop
launch_missile() parameter sublaunch, and simplify its caller.
Markus Armbruster [Tue, 13 Oct 2009 23:33:33 +0000 (19:33 -0400)]
News reported victim as actor for sub-launched anti-sat and ABM
If the intercepted missile was sub-launched as well, this disclosed
its owner.
The stock game's anti-sats and ABMs can't be sub-launched.
Markus Armbruster [Sun, 11 Oct 2009 15:58:00 +0000 (11:58 -0400)]
Clarify how perform_mission() uses missiles
Interdiction of ships and land units with missiles happens elsewhere.
Oops when perform_mission() strays on that turf.
Markus Armbruster [Sat, 10 Oct 2009 22:26:31 +0000 (18:26 -0400)]
Refactor missile interception code
Keep only the common part in msl_intercept(), and give it internal
linkage. Wrap new msl_abm_intercept() and msl_asat_intercept() around
it. They are simpler to use.
Markus Armbruster [Sat, 10 Oct 2009 22:15:22 +0000 (18:15 -0400)]
Fix defense value of intercepted missiles and satellites
Use the plane's defense value, not the plane type's base value.
Markus Armbruster [Sat, 10 Oct 2009 21:07:27 +0000 (17:07 -0400)]
Fix missiles interdicting ships outside range or op area
Ship interdiction works sector by sector. Interdicting missiles
targeted all ships not yet interdicted, not just the ones in the
current sector. This could lead to interdiction outside missile range
or op area.
Markus Armbruster [Sat, 10 Oct 2009 20:32:18 +0000 (16:32 -0400)]
Get rid of msl_launch_mindam()
It's awkward, especially in shp_missile_interdiction(). Inline into
callers and simplify.
Markus Armbruster [Sat, 10 Oct 2009 16:23:38 +0000 (12:23 -0400)]
Simplify control logic in msl_intercept()
Markus Armbruster [Sat, 10 Oct 2009 15:54:49 +0000 (11:54 -0400)]
Don't attempt to hide owner of sub-launched satellite
The attempt was pointless, because the recipient of the message could
see the owner on skywatch, and the news reported it as well.
Markus Armbruster [Sat, 10 Oct 2009 15:07:29 +0000 (11:07 -0400)]
Fix typo in info Selector
Markus Armbruster [Mon, 5 Oct 2009 11:27:43 +0000 (07:27 -0400)]
Move msl_equip() to callers, internal linkage
Markus Armbruster [Mon, 5 Oct 2009 11:25:45 +0000 (07:25 -0400)]
Move "Releasing RV's" message into detonate()