Commit graph

4914 commits

Author SHA1 Message Date
d9837728c2 configure: Enable more gcc warnings
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-12-05 12:11:37 +01:00
23373d01d9 configure: Test compiler flags
When AC_PROG_CC detects GCC, Make.mk adds a bunch of flags to CFLAGS.
Works only for flags that any version of gcc in use accepts.

Instead, make configure add the flags that actually work to CFLAGS.
This will let us add flags that work only for some compilers.

The new autoconf macros are from autoconf-archive v2015.02.24.

Unfortunately, AX_APPEND_COMPILE_FLAGS doesn't work reliably for
-Wno-*: gcc complains about unknown -Wno-foo only when other
diagnostics are being produced.  Test -Wfoo instead of -Wno-foo, and
rename to MY_APPEND_COMPILE_FLAGS.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-11-22 10:23:54 +01:00
35f34581be configure: Drop unused AC_C_CHAR_UNSIGNED test
Unused since commit 0c8c169. v4.3.3.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-06-06 15:49:28 +02:00
87d08a4584 Bump version to 4.3.34
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-06-04 10:52:11 +02:00
00985535de Update change log timestamp for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-20 20:20:40 +02:00
fff177be2f Revert "commands: Always put ship or land unit before retreating it"
This reverts commit f4d8d64bb3.

Breaks retreat after ship got sunk by bombs or missile.

ship_bomb() and launch_missile() pass .shp_own to retreat_ship().
Wrong after putship(), because putship() resets the owner when the
ship got sunk.  retreat_ship() then oopses and fails to retreat the
surviving members of the group.

Other callers save the owner before putting the ship, and pass that.
We could change these two to do the same.  But since we're trying to
get a release out, simply revert the broken commit instead.
2015-05-17 18:11:20 +02:00
1c9fb831ed Tidy up some comments
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-17 18:08:45 +02:00
5b9b4c3c89 Update change log again for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:49:12 +02:00
341b1b4d15 Improve portability to really outmoded compilers
A few modernisms have crept in:

* Trailing comma in enum definition (commit 71320ed, v4.3.10)

* // comment (commit 265e71e, v4.3.11)

* <stdint.h> (commit 9102ecc, v4.3.31)

  MSC actually chokes on this one.

Avoid them.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:57 +02:00
7f68f37433 xundump: Pass unsigned * for scanf directive %3o, not int *
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:57 +02:00
a96c43c723 rdsched: Pass unsigned * for scanf directive %u, not int *
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:57 +02:00
05fe8b771c info/History: Cover removal of Autonav, SAIL and TREATIES
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:48:35 +02:00
a455169edd w32/strptime: Fix for 64 bit pointers
The __UNCONST() stolen from NetBSD assumes unsigned long can hold a
pointer.  Not true with Win64's LLP64 data model.  There, we cast the
64 bit pointer to 32 bits and back.  Works only because Windows puts
the stack at a very low address, and the casts don't actually change
the pointer.

Dumb it down to a straight cast to void * for safety.

Thanks to Harald Katzer and Ron Koenderink for their help figuring out
the bug's impact.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-05-14 09:39:19 +02:00
953ff83fb1 Update change log again for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-13 07:07:03 +01:00
884dd4d532 INSTALL: Refresh from automake 1.13
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 18:23:33 +01:00
64f32cde53 man: Get rid of unwanted space in SYNOPSIS
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 17:48:17 +01:00
Marisa Giancarla
0a6eb70b28 client: New option -r for restricted mode
Redirections and the execute command let the user read and write files
and run programs on the local system.

Restricted mode prevents such access.  This is useful when you want to
grant somebody access to just Empire, but not to the host system's
user account that runs the client.

Signed-off-by: Marisa Giancarla <fstltna@me.com>
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 17:30:46 +01:00
89b76644b2 torpedo mission: Print rounded, not truncated hit chance
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 14:58:04 +01:00
bfea5a2cf4 build: Fix inexact calculation of required materials
sector_can_build() computes mat[i] * (effic / 100.0).  The division is
inexact.  The result gets randomly rounded, so errors are vanishingly
unlikely to screw up material consumption.

However, we require the amount rounded up to be present since commit
1227d2c.  Errors *can* screw that up.  Fix by avoiding inexact
computation for that part.

We should probably review rounding of inexact values in general.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 14:06:02 +01:00
c869c868e2 tests/README: Cover info.ps and document .NA use for commands
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 12:44:02 +01:00
8ca51001f0 tests/README: Update for replacement of info/checklist.pl
Replaced by tests/info-test in commit 90eaf9d.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-08 12:42:00 +01:00
3f52b38294 build-aux: Refresh from automake 1.13
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-07 10:44:21 +01:00
9f1da0882e m4: Refresh from autoconf-archive v2015.02.24
commit dd946914edb9da25e2d8c8b2186fab5d8103f3d4
Author: Daniel Richard G <skunk@iSKUNK.ORG>
Date:   Thu Oct 3 18:56:24 2013 +0200

    AX_PTHREAD: add support for Clang

    Further details can be found at <http://savannah.gnu.org/patch/?8186>.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-04 20:10:13 +01:00
0748a74b5d tests: Rewrite the previous commit's sed_i helper
Last night's version looks unnecessarily ugly in the morning.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-04 08:15:13 +01:00
7d249141be tests: Avoid non-portable sed -i
Crept in in commit 7c3186f.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-03 20:45:07 +01:00
dc6cffa131 tests: Fix for builds outside git-controlled source tree
We run "git ls-files" in the build tree.  Doesn't work when the source
directory isn't a git repository, or the build directory is outside
the source directory.  Broken in commit 71cb2d8.

Find source files like Make.mk does: if the source tree is a git
repository, use git ls-files, else use sources.mk.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-03 20:18:38 +01:00
deabb8eda6 Belatedly bump version to 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 21:16:27 +01:00
0d99ced788 bridgefall: Clean up literal 20 to SCT_MINEFF
Messed up in commit 4824648.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
bb3618929a Update change log for 4.3.33
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
8cb0a7fa0f add: Drop syntax deprecated in 4.3.29
Deprecated in commit 373f20a: argument "new".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
5400fd87a5 subs/move: Drop syntax deprecated in 4.3.27
Deprecated in commit 28d4847: no space between 'm' and its first
argument.  Affects explore, move, test, transport.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
f374ef64dd maps: Drop bmap flags syntax deprecated in 4.3.27
Deprecated in commit a00f9e2: 'r' with flags, and bad flags after 't'.
Affects flags argument of bmap, sbmap, pbmap, lbmap, nbmap, and
navigate and march sub-command 'B'.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
f150d9cb9f info/fire: Drop misinformation on damage varying with gun size
Goes all the way back to Empire 1, and as far as I can tell was
misleading there already.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
51f101df21 info/fire info/torpedo: Purge references to option MULTIFIRE
MULTIFIRE became non-optional in Chainsaw 3, more than two decades
ago.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:53 +01:00
e60f0be73f emp_config: Don't monkey-patch WORLD_X to be even
emp_config() silently truncates WORLD_X to even.  Drop that.  We could
flag odd WORLD_X as error, but we don't validate the other
configuration values, so why this one?  Instead document it needs to
be even.  WORLD_Y, too.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
ab82a804a6 ef_verify: Polish product error message
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
a4a25df2f4 init ef_verify: Don't monkey-patch capability VTOL, require it
A plane with capability missile must have capability VTOL.  When it's
missing, global_init() silently adds it.

Drop that.  Check for it in ef_verify_config() instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
c0c58222bc init ef_verify: Don't monkey-patch capability miss, require it
A ship with non-zero nplanes must have capability plane or miss.  When
one doesn't, global_init() silently adds capability miss.

Drop that.  Check for it in ef_verify_config() instead.  Fix up
ship.config accordingly.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
c3a26dc899 ef_verify: Require ship glim != 0 with capability dchrg
Because the fire command doesn't work with zero glim (commit a109de9).

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
0e24049ce4 torpedo: Suppress bulletin when player torpedoes his own ship
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
88bfa2e6a3 torpedo: Print "Starting our attack run" regardless of target
Instead of printing it only when the target owned by somebody else.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
33497e4242 torpedo: Let torpedo hit land only when target is in range
Telling the player his torpedo "slams into land" can give a clue on
the direction to the target.  No good when the target is out of range,
because we shouldn't tell the player more than that then.

Screwed up in 4.2.2.  Fix by checking range before line of sight.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
bb6c974ef2 info/torpedo: Fix misinformation on submarine identification
Claims the victim of a torpedo attack gets told the attacking ship's
number.  This hasn't been the case for submarines since Empire 2.3.
Recent commits again reveal the attacking submarine's number, but only
when it gets hit by return fire.  Update info accordingly.

Reported-by: Neeraj Jain <thisisfranz@gmail.com>
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
05671c69b4 info/torpedo: Cover return torpedoes, drop depth charge details
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
17abdbc5e0 torpedo fire: Reveal sub hit by return fire or depth charge
This partly reverts a change made in Empire 2.3 to tell a submarine's
opponent only that he's dealing with a "sub" instead of the
submarine's UID and type.  Hiding submarines is done by prsub().
Uses:

* Command torpedo: defender depth charges or torpedoes an attacking
  submarine

  If you can attack a submarine reactively, you should be able to
  attack it actively, too.  But that requires its UID.  Reveal it
  again, but keep the type hidden.

* Command fire: defender fires back at a submarine using its deck gun

  Submarines need to surface to fire deck guns, so they shouldn't be
  treated any different than surface ships.  Revert Empire 2.3's
  change entirely there, i.e. defender learns type as well as UID.

* Command torpedo: attacking submarine hits its target

  Keep the submarine hidden.

* Commands torpedo and fire: attacking ship hits a submarine

  The attacker passed the UID as command argument, so it doesn't
  matter whether we print it or not.  Printing it is simpler to code,
  so do that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
76214dbfbd torpedo: New variable sub_mcp to make code more concise
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
695352d9d3 tests/torpedo: New; exercises torpedo command
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
81710a935c tests/fire: Cover firing at unused / sunk ships
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
ebb36f8dc3 tests/fire: Cover firing with foreign assets
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
165fbed512 fire: Clean up damage sanity check and printing of range
Repeated for ship, sector and land unit firing.  The latter prints
range only when the sanity check succeeds.

Factor out, changing ship and sector to behave like land unit firing.

When the sanity check fails, print "Jammed!" instead of "Klick!",
because "Klick!" suggests no shells.  Used to be printed exactly then,
but the condition first became impossible (Chainsaw), then generalized
to "can't fire for whatever reason" (commit 22c6fd8, v4.3.12).

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00