Commit graph

5394 commits

Author SHA1 Message Date
5363ef85d4 tests/actofgod: Fix owner of plane 7/8
Planes 7/8 aren't visible in output, because the test neglects to set
their owner.  Messed up in commit commit efec441, v4.3.33.  Correct
that oversight.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 07:23:45 +01:00
16e565ed5f edit: Implement editing bars on ships and land units
The edit command doesn't support editing bars on ships and land units.
Has always been that way.  The stock game's ships have always been
unable to load bars.  Not the case for land units.

Unfortunately, the obvious key 'b' for bars was burned on plague time
in 4.0.17.  Use key 'B' instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 07:23:45 +01:00
647dc66a40 tests/actofgod: Test give and edit for each item type
The test covers only 'c' and 'l' with give, 'm' and 'g' with edit.
Cover the other item types, too.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 07:23:45 +01:00
2902cc22c4 edit: Print ship and land unit items with field width 5
print_items() uses field widths between 3 and 5.  They go back all the
way to Empire 1, and are fine for the stock game.  Widen the narrower
ones to 5, because a consistent field width looks tidier, and can
avoid misaligned columns with customized ships and land units.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 07:23:45 +01:00
6e320cc625 edit: Factor print_items() out of print_land(), print_ship()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2021-01-05 07:23:45 +01:00
60429028e7 update/revolt: Fix land unit casualties
Fix the bug demonstrated by the previous commit:
take_casualties_from_lands() limits total casualties to @each.  It
should limit each land unit's casualties, and only if !may_kill.  This
can lead to fewer casualties than called for; oops in
take_casualties().  Broken in commit 025e9cc25, v4.4.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2018-04-29 10:33:48 +02:00
d111522fe8 Update copyright notice
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2018-04-29 10:33:19 +02:00
9fcd254538 tests/update: Demonstrate take_casualties_from_lands() bug
Tweak military in land units to demonstrate that
take_casualties_from_lands() can kill fewer military than it should.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2018-04-10 16:48:20 +02:00
5dee2b16d5 tests/update: Belatedly update for commit 35ecc008c
Commit 35ecc008c fixed take_casualties() to destroy land units only
when casualties demand it.  This test demonstrated the change: inf#29
no longer dies.  Good.  However, this lost coverage of land units
dying in a sucessful defense.  Bad.

I could tweak inf#29 to get destroyed again, but that would lose
coverage of the bug fixed by commit 35ecc008c.  Make linf#28 die
instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2018-04-10 16:47:54 +02:00
fffff8680b info/Empire4.4: Fix a botched 4.4.0 change log entry
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-10 17:40:07 +02:00
11756fc9c9 ef_verify: Fix error message in verify_land_chr()
It points to the wrong table.  Screwed up in commit 33800fc.  Correct
the pasto.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 17:59:03 +02:00
689652d1b0 info/Empire4.4: Update release date once more
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 17:59:00 +02:00
664f640979 info/retreat info/lretreat: Fix truncated glossary list items
Text after the first space is missing in the formatted output.  That's
because .L takes just one argument, but we pass several.  Broken in
commit 4e0d02b, v4.3.33.  Fix by quoting the argument text.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 11:11:50 +02:00
e6d2615648 scripts/backup: Fix initialization of $email
Mostly harmless in practice, since $email is typically unset.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 10:44:02 +02:00
f0dbddd590 scripts/savecore: Amend the hint on core_pattern, drop stray ';'
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 10:41:05 +02:00
30382d9d03 scripts src/scripts: Clean up inconsistent shell variable quoting
Signed-off-by: Markus Armbruster <armbru@redhat.com>
2017-09-03 10:37:11 +02:00
0447b529bd Make: Make src/scripts/gen-tarball-version a bit nicer
When autoconf is stale, include a reminder how to fix that in the
error message.

While there, cd to $nv like we do in src/scripts/gen-client-configure
for slightly terser code.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 10:28:06 +02:00
b0bea7418a Make: Fix src/scripts/tarball argument parsing
The test for -x uses non-portable operator ==.  Screwed up in commit
63c6dd6.  Fix by using getopts instead.

Missing mandatory arguments aren't diagnosed.  Screwed up in initial
commit 1991652, v4.3.0.  Fix by checking shift's return status.

The error message for missing argument of -C neglects to print $0 and
uses echo in a non-portable way.  Also screwed up in commit 1991652.
Fix the obvious way.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 10:26:47 +02:00
8e8bed5865 configure: Fix botched fix of .tarball-version access
Commit ece998e fixed .tarball-version access from separate build tree
by adding $srcdir/ to it.  That's wrong in m4_esyscmd(), because there
it runs at autoconf time, where $srcdir isn't necessary and doesn't
exist.  Revert that part.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-03 07:39:11 +02:00
e87bef161f client: Belatedly add dependencies for fnameat.o
Forgotten in commit a0220e8.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-02 23:08:09 +02:00
5e1b590867 Make: Support shallow git clones for testing
Since commit 1ec9b94, we derive the version number from git tags with
build-aux/git-version-gen.  When a shallow clone doesn't include a
suitable tag, this fails, and make refuses to build anything.  Since
Travis uses git-clone --depth=50, it'll break as soon as we've got
more than 50 commits since the last release.

Support arbitrarily shallow clones for limited purposes like testing
by falling back from a proper V.N-H version number to UNKNOWN-H.

To guard against use of such builds for other purposes, log a warning
on server startup, and print one on player login.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-02 17:51:37 +02:00
41ce9e37fd Bind Travis notifications to main mirror
Signed-off-by: Gerd Flaig <gefla@pond.sub.org>
Message-Id: <877exhmdk6.fsf@oxygen.pond.sub.org>
[Comment clarified slightly]
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-02 15:37:01 +02:00
ec513bb2aa README: Advise on lack of readline
Missed in commit f1fc0df.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-02 15:03:45 +02:00
3a13ba1f1f client: Add a missing #include <string.h>
play.c needs <string.h> since commit f1fc0df.  My version of
<readline/readline.h> pulls it in, but at least Apple's (derived from
NetBSD's) doesn't, and we get warnings then.  Add the missing

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-02 15:01:17 +02:00
ece998e064 configure: Fix .tarball-version access from separate build tree
configure reads .tarball-version when the source tree isn't
git-controlled.  Fails when the build tree is separate.  Fix it to
read $srcdir/.tarball-version.

The occurence in Make.mk isn't wrong, because VPATH applies there.
Change it anyway, for consistency and a bit of extra robustness.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-02 15:00:14 +02:00
74396d7fbf info/Empire4.4: Update release date
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-01 20:21:09 +02:00
6d1e4dcdfa info/Update-sequence: Explicitly document prepare order
Sectors, ships, planes and land units are always visited in the same
order, but it doesn't hurt to be explicit.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-09-01 20:17:15 +02:00
6ab4848cc7 travis: Specify dist to fix Linux build
The build fails on Travis since we require autoconf 2.69 (commit
db055a).  Travis still defaults to Ubuntu Precise, and Precise's
autoconf is too old.  We could revert commit db055a and rely on Travis
to keep things working with old autoconf.  But Precise reached end of
life a couple of months ago, and I suspect it's only a matter of time
until Travis drops it, too.

Fix the build on Travis by requesting Trusty.  Its end of life is
planned for April 2019.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-27 11:31:58 +02:00
7c9c795c31 travis: Configure notifications
Notifications go to the mailing list and to the IRC channel.

Signed-off-by: Gerd Flaig <gefla@pond.sub.org>
Message-Id: <871so1nqcx.fsf@oxygen.pond.sub.org>
[Commit message tweaked]
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-24 22:01:29 +02:00
c3a34c9730 Drop superfluous #include
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-22 20:12:42 +02:00
ed26bc80ac Make: Make "make dist" catch stale configure
As commit 1ec9b94 explains, the version reported by configure is fixed
at configure generation time.  "make dist" happily distributes a stale
one.  Not terrible, because all that's stale is the output of
configure --version, just embarrassing.

Make gen-tarball-version fail when the configure --version doesn't
match the tarball version.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-13 14:31:07 +02:00
10ddaca6b1 Make: Fix configure generated for dist-client
Commit 1ec9b94 broke regeneration of configure for dist-client: it
uses .tarball-version, which exists only in the tarball, not in the
source tree.

Generating the client's autoconf stuff into the source tree is a
questionable idea anyway, as it won't run there.  Generate it while
building the tarball instead.

Bonus: doesn't distribute a useless .dirty-stamp.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-13 14:31:07 +02:00
63c6dd6896 Make: Move .tarball-version generation out of src/scripts/tarball
Commit 1ec9b94 made src/scripts/tarball generate .tarball-version and
.dirty-stamp.  Hardcoding it like that there is a bit ugly.

Move it into a separate tweak script that is run right before tar.
We'll tweak some more in the next commits.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-13 14:00:16 +02:00
240474195d src/scripts/tarball: Clean up to prepare for the next commit
We don't save $1 in a variable, only $1-$2.  Okay, because we don't
need $1 by itself.  However, the next commit will.  So save it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-13 13:38:10 +02:00
1f53a56e9d Drop stale comment from .gitignore
Commit e597257 folded $(bld_distgen) into $(src_distgen), but
neglected to update comments in .gitignore.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-13 13:25:03 +02:00
042d43f30d Make: Drop unused variable VERSION
Missed in commit 1ec9b94.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-13 10:50:27 +02:00
5f59699cfd Make: Fix "make dist" to remake stale files in $(srcdir)
Broken in commit bb0f3a6.  VPATH claims another victim.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 10:13:29 +02:00
c28571640b build-aux/git-version-gen: Refresh from Gnulib commit d93aa1d
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:59:59 +02:00
af72ecd75f tests: Normalize version numbers to 4.4.0 instead of 4.3.34
Commit 1ec9b94 normalized version numbers in test output to 4.3.34,
because that was thought to be the next version then.  4.3.34 has
become 4.4.0 meanwhile.  Update the normalization just to avoid
mention of 4.3.34.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:50:17 +02:00
1288e55103 info/version: Update example to current output
Current output of the version command, except replace version number
4.3.33.N-H-dirty by 4.4.0.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:50:17 +02:00
3193c22ac2 info: Update change log for 4.4.0
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:35:55 +02:00
ef5903cd9d info/xdump: Update advice on xdump evolution
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:32:01 +02:00
d3de388ad4 Drop a a few accidentally repeated words
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:32:01 +02:00
25a7ae3068 info: Split Empire4 into Empire4.0, Empire4.2, Empire4.3
"info Empire4" has become unwieldy: more than 4000 lines, almost a
quarter of a Megabyte.  Split it up.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:32:00 +02:00
54f54ac081 doc: Drop redundant doc/CHANGES4.X, improve README
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 09:31:07 +02:00
024638ed5d doc: Rename CHANGES to CHANGES2.0
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:27:50 +02:00
22e4b1fc45 info: Consistently spell Empire 2, 3 and 4 with a space
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:27:50 +02:00
ae8a3582a2 info/Clients: Outdated and misleading, delete
The .NA header promises information on "Clients which communicate well
with the Empire4 Server".  The page doesn't really deliver.  It talks
about client support for asynchronous notifications.  It stopped
listing separate client projects in 4.0.7 (1997).  Not mentioning such
clients isn't just outdated, it's actively misleading.

Perhaps an up-to-date info page on clients would be useful, but I
can't write one right now.  Delete.

Loses a bit of information for client developers that was tacked on in
4.0.7: pointers to dump commands, and an explanation of timestamps.  I
trust client writers can find "info xdump" without this.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:27:44 +02:00
952fb252a3 info: Trim .SA of change log pages to just "Server"
Looks like an attempt was made to have .SA point to info pages for
significantly changed things.  It wasn't done consistently, though,
and it's impractical for Empire 4.  Drop these references, and keep
only "Server".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:10:17 +02:00
473187e12b info: Improve .NA and first paragraph of change log pages
The .NA show up in "info Server", like this:

   Chainsaw !   Changes from KSU Empire to Chainsaw code
    Empire2 !   Changes from the Chainsaw server to the Empire2 Server
    Empire3     Changes from the Empire2 server to the Empire3 Server
    Empire4 !   Changes from the Empire3 server to the Empire4 Server
[...]
       Merc     Changes from KSU code to Merc code
 Old-empire !   Differences from 1.2 to UCB Empire

Tweak them to look like this:

   Chainsaw !   Changes from KSU Empire to Chainsaw (1992-93)
    Empire2 !   Changes from Chainsaw to Empire 2 (1995)
    Empire3     Changes in Empire 3 (1995-96)
    Empire4 !   Changes in Empire 4 (1996-present)
[...]
       Merc     Changes from KSU code to Merc code (1992)
 Old-empire !   Differences from 1.2 to UCB Empire

The first paragraph of Empire2.t refers to "the new Empire 2" server.
Drop "new", because it clearly ain't anymore.  Same for Empire3.t.

The first paragraph of Empire4.t claims "several changes/fixes" have
been made.  Umm, that's only tenuously connected to reality by now.
Rewrite the paragraph.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2017-08-12 08:07:44 +02:00