empserver
5 months agoupdate/revolt: Fix land unit casualties changeling master
Markus Armbruster [Tue, 10 Apr 2018 14:31:11 +0000 (16:31 +0200)]
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>
5 months agoUpdate copyright notice
Markus Armbruster [Tue, 10 Apr 2018 14:29:27 +0000 (16:29 +0200)]
Update copyright notice

Signed-off-by: Markus Armbruster <armbru@redhat.com>
6 months agotests/update: Demonstrate take_casualties_from_lands() bug
Markus Armbruster [Tue, 10 Apr 2018 12:17:41 +0000 (14:17 +0200)]
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>
6 months agotests/update: Belatedly update for commit 35ecc008c
Markus Armbruster [Tue, 10 Apr 2018 12:04:51 +0000 (14:04 +0200)]
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>
13 months agoinfo/Empire4.4: Fix a botched 4.4.0 change log entry
Markus Armbruster [Sun, 10 Sep 2017 15:40:07 +0000 (17:40 +0200)]
info/Empire4.4: Fix a botched 4.4.0 change log entry

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 months agoef_verify: Fix error message in verify_land_chr() v4.4.0
Markus Armbruster [Sun, 3 Sep 2017 15:38:34 +0000 (17:38 +0200)]
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>
13 months agoinfo/Empire4.4: Update release date once more
Markus Armbruster [Sun, 3 Sep 2017 15:18:39 +0000 (17:18 +0200)]
info/Empire4.4: Update release date once more

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 months agoinfo/retreat info/lretreat: Fix truncated glossary list items
Markus Armbruster [Sun, 3 Sep 2017 09:11:50 +0000 (11:11 +0200)]
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>
13 months agoscripts/backup: Fix initialization of $email
Markus Armbruster [Sun, 3 Sep 2017 08:44:02 +0000 (10:44 +0200)]
scripts/backup: Fix initialization of $email

Mostly harmless in practice, since $email is typically unset.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 months agoscripts/savecore: Amend the hint on core_pattern, drop stray ';'
Markus Armbruster [Sun, 3 Sep 2017 08:41:05 +0000 (10:41 +0200)]
scripts/savecore: Amend the hint on core_pattern, drop stray ';'

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 months agoscripts src/scripts: Clean up inconsistent shell variable quoting
Markus Armbruster [Sun, 3 Sep 2017 08:37:11 +0000 (10:37 +0200)]
scripts src/scripts: Clean up inconsistent shell variable quoting

Signed-off-by: Markus Armbruster <armbru@redhat.com>
13 months agoMake: Make src/scripts/gen-tarball-version a bit nicer
Markus Armbruster [Sun, 3 Sep 2017 08:28:06 +0000 (10:28 +0200)]
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>
13 months agoMake: Fix src/scripts/tarball argument parsing
Markus Armbruster [Sun, 3 Sep 2017 08:07:15 +0000 (10:07 +0200)]
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>
13 months agoconfigure: Fix botched fix of .tarball-version access
Markus Armbruster [Sun, 3 Sep 2017 05:30:08 +0000 (07:30 +0200)]
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>
13 months agoclient: Belatedly add dependencies for fnameat.o
Markus Armbruster [Sat, 2 Sep 2017 21:06:24 +0000 (23:06 +0200)]
client: Belatedly add dependencies for fnameat.o

Forgotten in commit a0220e8.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 months agoMake: Support shallow git clones for testing
Markus Armbruster [Sat, 2 Sep 2017 15:18:30 +0000 (17:18 +0200)]
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>
13 months agoBind Travis notifications to main mirror
Gerd Flaig [Sat, 2 Sep 2017 13:32:09 +0000 (15:32 +0200)]
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>
13 months agoREADME: Advise on lack of readline
Markus Armbruster [Sat, 2 Sep 2017 12:57:06 +0000 (14:57 +0200)]
README: Advise on lack of readline

Missed in commit f1fc0df.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 months agoclient: Add a missing #include <string.h>
Markus Armbruster [Sat, 2 Sep 2017 12:45:53 +0000 (14:45 +0200)]
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>
13 months agoconfigure: Fix .tarball-version access from separate build tree
Markus Armbruster [Sat, 2 Sep 2017 12:23:28 +0000 (14:23 +0200)]
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>
13 months agoinfo/Empire4.4: Update release date
Markus Armbruster [Fri, 1 Sep 2017 18:21:09 +0000 (20:21 +0200)]
info/Empire4.4: Update release date

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
13 months agoinfo/Update-sequence: Explicitly document prepare order
Markus Armbruster [Fri, 1 Sep 2017 18:17:15 +0000 (20:17 +0200)]
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>
13 months agotravis: Specify dist to fix Linux build v4.4.0-rc2
Markus Armbruster [Sat, 26 Aug 2017 07:11:27 +0000 (09:11 +0200)]
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>
13 months agotravis: Configure notifications
Gerd Flaig [Thu, 24 Aug 2017 11:43:10 +0000 (13:43 +0200)]
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>
13 months agoDrop superfluous #include
Markus Armbruster [Tue, 22 Aug 2017 18:12:42 +0000 (20:12 +0200)]
Drop superfluous #include

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoMake: Make "make dist" catch stale configure
Markus Armbruster [Sun, 13 Aug 2017 12:18:37 +0000 (14:18 +0200)]
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>
14 months agoMake: Fix configure generated for dist-client
Markus Armbruster [Sun, 13 Aug 2017 12:11:06 +0000 (14:11 +0200)]
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>
14 months agoMake: Move .tarball-version generation out of src/scripts/tarball
Markus Armbruster [Sun, 13 Aug 2017 12:00:16 +0000 (14:00 +0200)]
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>
14 months agosrc/scripts/tarball: Clean up to prepare for the next commit
Markus Armbruster [Sun, 13 Aug 2017 11:38:10 +0000 (13:38 +0200)]
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>
14 months agoDrop stale comment from .gitignore
Markus Armbruster [Sun, 13 Aug 2017 11:25:03 +0000 (13:25 +0200)]
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>
14 months agoMake: Drop unused variable VERSION
Markus Armbruster [Sun, 13 Aug 2017 08:50:27 +0000 (10:50 +0200)]
Make: Drop unused variable VERSION

Missed in commit 1ec9b94.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoMake: Fix "make dist" to remake stale files in $(srcdir) v4.4.0-rc1
Markus Armbruster [Sat, 12 Aug 2017 08:13:29 +0000 (10:13 +0200)]
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>
14 months agobuild-aux/git-version-gen: Refresh from Gnulib commit d93aa1d
Markus Armbruster [Sat, 12 Aug 2017 07:59:59 +0000 (09:59 +0200)]
build-aux/git-version-gen: Refresh from Gnulib commit d93aa1d

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agotests: Normalize version numbers to 4.4.0 instead of 4.3.34
Markus Armbruster [Sat, 12 Aug 2017 07:21:03 +0000 (09:21 +0200)]
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>
14 months agoinfo/version: Update example to current output
Markus Armbruster [Sat, 12 Aug 2017 07:18:59 +0000 (09:18 +0200)]
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>
14 months agoinfo: Update change log for 4.4.0
Markus Armbruster [Sat, 12 Aug 2017 05:51:20 +0000 (07:51 +0200)]
info: Update change log for 4.4.0

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo/xdump: Update advice on xdump evolution
Markus Armbruster [Sat, 12 Aug 2017 06:47:41 +0000 (08:47 +0200)]
info/xdump: Update advice on xdump evolution

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoDrop a a few accidentally repeated words
Markus Armbruster [Sat, 12 Aug 2017 04:06:47 +0000 (06:06 +0200)]
Drop a a few accidentally repeated words

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo: Split Empire4 into Empire4.0, Empire4.2, Empire4.3
Markus Armbruster [Fri, 11 Aug 2017 19:39:03 +0000 (21:39 +0200)]
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>
14 months agodoc: Drop redundant doc/CHANGES4.X, improve README
Markus Armbruster [Fri, 11 Aug 2017 19:37:13 +0000 (21:37 +0200)]
doc: Drop redundant doc/CHANGES4.X, improve README

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agodoc: Rename CHANGES to CHANGES2.0
Markus Armbruster [Fri, 11 Aug 2017 19:22:16 +0000 (21:22 +0200)]
doc: Rename CHANGES to CHANGES2.0

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo: Consistently spell Empire 2, 3 and 4 with a space
Markus Armbruster [Fri, 11 Aug 2017 18:31:26 +0000 (20:31 +0200)]
info: Consistently spell Empire 2, 3 and 4 with a space

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo/Clients: Outdated and misleading, delete
Markus Armbruster [Fri, 11 Aug 2017 18:09:51 +0000 (20:09 +0200)]
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>
14 months agoinfo: Trim .SA of change log pages to just "Server"
Markus Armbruster [Fri, 11 Aug 2017 17:54:45 +0000 (19:54 +0200)]
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>
14 months agoinfo: Improve .NA and first paragraph of change log pages
Markus Armbruster [Fri, 11 Aug 2017 17:53:15 +0000 (19:53 +0200)]
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>
14 months agoinfo/Wolfpack: Redundant, delete
Markus Armbruster [Fri, 11 Aug 2017 17:34:28 +0000 (19:34 +0200)]
info/Wolfpack: Redundant, delete

The .TH and .NA header promise information about "Wolfpack Code" and
"The Wolfpack Project", but the body doesn't really deliver.  It's
basically the first paragraph of Empire4.t plus pointers to Options.t
and Empire.t.  Has been that way since it was added in 4.0.2.
History.t covers the Wolfpack project more usefully, so delete this
one.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo: Drop outdated bug report instructions
Markus Armbruster [Fri, 11 Aug 2017 17:04:12 +0000 (19:04 +0200)]
info: Drop outdated bug report instructions

Ken Stevens stopped maintaining Empire many years ago, but "info
Empire2" and "info Empire3" still direct users to him.  Drop that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agotrade: Don't increase negative mobility to zero on trade
Markus Armbruster [Thu, 10 Aug 2017 04:45:42 +0000 (06:45 +0200)]
trade: Don't increase negative mobility to zero on trade

check_trade() sets plane and land unit mobility to zero on trade.
Even when it's negative.  Fix to leave it alone then.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo/Chainsaw: Rename from CHANGES.CHAINSAW
Markus Armbruster [Thu, 10 Aug 2017 04:19:10 +0000 (06:19 +0200)]
info/Chainsaw: Rename from CHANGES.CHAINSAW

No need to shout.  Name it like we do for other server versions instead.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo/Plane-types: Document helo takeoff/landing in mountains
Markus Armbruster [Sat, 5 Aug 2017 19:28:17 +0000 (21:28 +0200)]
info/Plane-types: Document helo takeoff/landing in mountains

Forgotten in commit 6157b6c.  While there, fix the references to "show
ship stats" headings, and say "to paradrop" instead of "to paratroop".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoUse printf %d instead of %i, just for consistency
Markus Armbruster [Sat, 5 Aug 2017 19:15:15 +0000 (21:15 +0200)]
Use printf %d instead of %i, just for consistency

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoSpell ID and UID consistently all-caps
Markus Armbruster [Sat, 5 Aug 2017 19:14:20 +0000 (21:14 +0200)]
Spell ID and UID consistently all-caps

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo/territory: Drop the "id" from "territory id number"
Markus Armbruster [Sat, 5 Aug 2017 19:10:24 +0000 (21:10 +0200)]
info/territory: Drop the "id" from "territory id number"

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoman/fairland: Don't explain the default seed value
Markus Armbruster [Sat, 5 Aug 2017 19:03:34 +0000 (21:03 +0200)]
man/fairland: Don't explain the default seed value

How the default seed value is computed is an implementation detail of
no interest to the user.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoSpell the plural of an acronym consistently without apostrophe
Markus Armbruster [Sat, 5 Aug 2017 17:11:02 +0000 (19:11 +0200)]
Spell the plural of an acronym consistently without apostrophe

Opinions differ on how to pluralize acronyms[*], but let's be
consistent: say "BTUs", not "BTU's".

[*] https://en.wikipedia.org/wiki/Acronym#Representing_plurals_and_possessives

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoUse all-caps for a few acronyms and for "OK"
Markus Armbruster [Sat, 5 Aug 2017 16:52:17 +0000 (18:52 +0200)]
Use all-caps for a few acronyms and for "OK"

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoExpand a few unnecessary abbreviations in output text
Markus Armbruster [Sat, 5 Aug 2017 16:48:22 +0000 (18:48 +0200)]
Expand a few unnecessary abbreviations in output text

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agonavigate march: Say "to sweep mines" instead of "to minesweep"
Markus Armbruster [Sat, 5 Aug 2017 16:32:41 +0000 (18:32 +0200)]
navigate march: Say "to sweep mines" instead of "to minesweep"

The choice of "to minesweep" in "`d' to drop mines, and `m' to
minesweep" is obviously intentional.  But saying it in standard
English instead is at least as clear, so do that.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoCorrect spelling as one word and as two words
Markus Armbruster [Sat, 5 Aug 2017 16:29:36 +0000 (18:29 +0200)]
Correct spelling as one word and as two words

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoSpell harbor consistently
Markus Armbruster [Sat, 5 Aug 2017 15:04:23 +0000 (17:04 +0200)]
Spell harbor consistently

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoSpell BTU and ETU consistently
Markus Armbruster [Sun, 30 Jul 2017 14:55:04 +0000 (16:55 +0200)]
Spell BTU and ETU consistently

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoSpelling corrections
Markus Armbruster [Sun, 30 Jul 2017 14:49:03 +0000 (16:49 +0200)]
Spelling corrections

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoFix up a few identifier references in comments
Markus Armbruster [Mon, 24 Jul 2017 19:20:04 +0000 (21:20 +0200)]
Fix up a few identifier references in comments

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agobtu: Undo damage done to file comment in commit 9f25de3
Markus Armbruster [Mon, 24 Jul 2017 19:10:51 +0000 (21:10 +0200)]
btu: Undo damage done to file comment in commit 9f25de3

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoinfo/Mobility: Belatedly remove security unit mobility use
Markus Armbruster [Sat, 22 Jul 2017 09:41:45 +0000 (11:41 +0200)]
info/Mobility: Belatedly remove security unit mobility use

Missed in commit 39884af, v4.3.33.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agolwp: LwpCurrent can't be null, drop useless check
Markus Armbruster [Mon, 10 Jul 2017 18:39:02 +0000 (20:39 +0200)]
lwp: LwpCurrent can't be null, drop useless check

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agopowe: Delete dead assignment in gen_power().
Markus Armbruster [Mon, 10 Jul 2017 18:00:33 +0000 (20:00 +0200)]
powe: Delete dead assignment in gen_power().

It's been dead ever since commit 5635fc2 added it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoshow: Clean up long vs. int in fmttime2822() for Windows
Markus Armbruster [Sun, 9 Jul 2017 14:39:47 +0000 (16:39 +0200)]
show: Clean up long vs. int in fmttime2822() for Windows

fmttime2822() prints long with format %d, and passes long to abs().
Harmless, because both int and long are 32 bits in the Windows API.
Clean it up anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoMake: Fix distclean for separate build tree
Markus Armbruster [Sun, 9 Jul 2017 09:54:07 +0000 (11:54 +0200)]
Make: Fix distclean for separate build tree

Fix removal of autoconf-generated files in src/client/.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoUpdate copyright notice
Markus Armbruster [Sat, 8 Jul 2017 18:46:53 +0000 (20:46 +0200)]
Update copyright notice

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoMerge branch 'readline'
Markus Armbruster [Sat, 8 Jul 2017 18:43:29 +0000 (20:43 +0200)]
Merge branch 'readline'

14 months agorelations: Move relations state from struct natstr to relatstr
Markus Armbruster [Mon, 31 Oct 2016 17:05:07 +0000 (18:05 +0100)]
relations: Move relations state from struct natstr to relatstr

Relations state is relatively bulky: it's a big chunk of struct
natstr, and adds 200 bytes per country to xdump nat.

Relations change rarely.  Rewriting it to disk on every nation update
and retransmitting it in every xdump nat is wasteful.

To avoid this waste, move relations state to its own struct relatstr.

This is of course an xdump compatibility break.  We're not maintaining
xdump compatibility in this release.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agorelations: Create EF_RELAT table of struct relatstr
Markus Armbruster [Mon, 31 Oct 2016 16:42:34 +0000 (17:42 +0100)]
relations: Create EF_RELAT table of struct relatstr

New struct relatstr is basically empty so far.  The next commit will
move relations state from struct natstr to struct relatstr.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agonat: Move putnat() into nat_reset() and simplify
Markus Armbruster [Mon, 31 Oct 2016 16:20:05 +0000 (17:20 +0100)]
nat: Move putnat() into nat_reset() and simplify

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agorelations: Eliminate getrel()
Markus Armbruster [Mon, 31 Oct 2016 14:29:21 +0000 (15:29 +0100)]
relations: Eliminate getrel()

Most uses of getrel() have been replaced by the safer relations_with()
in commit 0c60e57..67b9135, v4.3.27.  Eliminate the remaining ones:

* Convert rela() to use relations_with().  The case of relations to
  self, where the two differ, doesn't occur.  The code becomes more
  easier to understand, even.

* relations_with() is then getrel()'s last user.  Inline.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agorelations: Inline relatename() into its only caller rela()
Markus Armbruster [Mon, 31 Oct 2016 14:26:26 +0000 (15:26 +0100)]
relations: Inline relatename() into its only caller rela()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agorelations: Encapsulate relates[] in relations_string()
Markus Armbruster [Mon, 31 Oct 2016 14:24:09 +0000 (15:24 +0100)]
relations: Encapsulate relates[] in relations_string()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agorelations: New enum relations
Markus Armbruster [Mon, 31 Oct 2016 13:54:21 +0000 (14:54 +0100)]
relations: New enum relations

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agorelations: Inline putrel() into its only caller setrel()
Markus Armbruster [Mon, 31 Oct 2016 13:17:27 +0000 (14:17 +0100)]
relations: Inline putrel() into its only caller setrel()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Change nat_accepts()'s first parameter to natid
Markus Armbruster [Mon, 31 Oct 2016 12:58:16 +0000 (13:58 +0100)]
reject: Change nat_accepts()'s first parameter to natid

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Move reject state from struct natstr to rejectstr
Markus Armbruster [Mon, 31 Oct 2016 12:48:48 +0000 (13:48 +0100)]
reject: Move reject state from struct natstr to rejectstr

Reject state is relatively bulky: it's a big chunk of struct natstr,
and adds almost 200 bytes per country to xdump nat.

Reject state changes rarely.  Rewriting it to disk on every nation
update and retransmitting it in every xdump nat is wasteful.

To avoid this waste, move reject state to its own struct rejectstr.

This is of course an xdump compatibility break.  We're not maintaining
xdump compatibility in this release.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Create EF_REJECT table of struct rejectstr
Markus Armbruster [Mon, 31 Oct 2016 12:26:37 +0000 (13:26 +0100)]
reject: Create EF_REJECT table of struct rejectstr

New struct rejectstr is basically empty so far.  The next commit will
move reject state from struct natstr to struct rejectstr.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Simplify printing of new state
Markus Armbruster [Mon, 31 Oct 2016 11:55:08 +0000 (12:55 +0100)]
reject: Simplify printing of new state

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: New enum rej_comm for REJ_TELE & friends
Markus Armbruster [Mon, 31 Oct 2016 10:44:04 +0000 (11:44 +0100)]
reject: New enum rej_comm for REJ_TELE & friends

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Replace getrejects() by nat_accepts()
Markus Armbruster [Mon, 31 Oct 2016 10:39:05 +0000 (11:39 +0100)]
reject: Replace getrejects() by nat_accepts()

All callers of getrejects() also check whether the sender is a deity.
Factor out the common code into nat_accepts(), and drop getrejects().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoaccept: Fix rejection check for divine senders
Markus Armbruster [Mon, 31 Oct 2016 10:31:10 +0000 (11:31 +0100)]
accept: Fix rejection check for divine senders

Communications from deities can't be rejected, but the accept command
fails to consider that detail.  Should not normally matter, because
the reject command doesn't let you reject deities.  Fix it anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Clean up typed_wu()'s check for deity
Markus Armbruster [Mon, 31 Oct 2016 10:18:02 +0000 (11:18 +0100)]
reject: Clean up typed_wu()'s check for deity

When sending a telegram, typed_wu() checks whether the recipient is
rejecting telegrams.  The check tacitly assumes from == player->cnum.
Happens to be the case, but clean it up anyway.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agowire: Fix announcement rejection for and from deities
Markus Armbruster [Mon, 31 Oct 2016 09:56:24 +0000 (10:56 +0100)]
wire: Fix announcement rejection for and from deities

Announcement rejection is completely broken for deities.
Additionally, deity announcements aren't exempted from rejection, but
that should not normally matter, because the reject command doesn't
let you reject deities.

Broken when announcements were separated from telegrams in Empire 3.
Fix to test the sender's instead of the player's divinity.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Exempt bulletins on relation change with deity
Markus Armbruster [Mon, 31 Oct 2016 09:20:30 +0000 (10:20 +0100)]
reject: Exempt bulletins on relation change with deity

Bulletins notifying on a relations change can be rejected just like a
telegram from the country initiating the change, except for one
inconsistency: telegrams from deities are exempt, but bulletins on a
relation change by a deity aren't.  Inconsistent since rejecting was
added in Merc Empire.

Change setrel() to treat relation change bulletins the same as tele()
treats telegrams.

Should not normally matter, because the reject command doesn't let you
reject deities.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agooffer: Exempt all deities from reject, not just POGO
Markus Armbruster [Sun, 30 Oct 2016 06:08:32 +0000 (07:08 +0100)]
offer: Exempt all deities from reject, not just POGO

Fix do_loan() to check !player->god instead of player->cnum != 0.
Screwed up when rejecting was added in Merc Empire.

Should not normally matter, because the reject command doesn't let you
reject deities.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoreject: Inline putreject() into its only caller setrej()
Markus Armbruster [Sat, 29 Oct 2016 15:13:04 +0000 (17:13 +0200)]
reject: Inline putreject() into its only caller setrej()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoaccept: Print YES and NO right- instead of left-justified
Markus Armbruster [Sat, 29 Oct 2016 09:25:56 +0000 (11:25 +0200)]
accept: Print YES and NO right- instead of left-justified

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoaccept: Don't rely on rejection flag encoding
Markus Armbruster [Sat, 29 Oct 2016 09:19:19 +0000 (11:19 +0200)]
accept: Don't rely on rejection flag encoding

Instead of enumerating all eight combinations of the three flags in a
table, simply print each flag on its own, and drop the table.  The old
table depends on the flag encoding, the new code doesn't.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agoaccept: Factor out rejection flags printing
Markus Armbruster [Sat, 29 Oct 2016 09:11:30 +0000 (11:11 +0200)]
accept: Factor out rejection flags printing

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agocontact: Change in_contact()'s first parameter to natid
Markus Armbruster [Sat, 29 Oct 2016 07:06:12 +0000 (09:06 +0200)]
contact: Change in_contact()'s first parameter to natid

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agocontact: Move contact state from struct natstr to contactstr
Markus Armbruster [Tue, 25 Oct 2016 17:38:02 +0000 (19:38 +0200)]
contact: Move contact state from struct natstr to contactstr

Contact state is relatively bulky: it's a big chunk of struct natstr,
and adds almost 200 bytes per country to xdump nat for deities.

Contact changes rarely.  Since we avoid unnecessary updates, it
doesn't change at all unless option HIDDEN is enabled.  Rewriting it
to disk on every nation update and retransmitting it in every deity
xdump nat is wasteful.

To avoid this waste, move contact state to its own struct contactstr.

This is of course an xdump compatibility break.  We're not maintaining
xdump compatibility in this release.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agocontact: Create EF_CONTACT table of struct contactstr
Markus Armbruster [Tue, 25 Oct 2016 17:33:19 +0000 (19:33 +0200)]
contact: Create EF_CONTACT table of struct contactstr

New struct contactstr is basically empty so far.  The next commit will
move contact state from struct natstr to struct contactstr.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agocontact: Rename getcontact() to in_contact()
Markus Armbruster [Sun, 23 Oct 2016 16:45:27 +0000 (18:45 +0200)]
contact: Rename getcontact() to in_contact()

The next commit will create a contact file, and the macro to get a
contact entry will be named getcontact().  Rename the existing
getcontact() out of the way.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agocontact: Avoid unnecessary nation updates
Markus Armbruster [Sun, 23 Oct 2016 16:38:56 +0000 (18:38 +0200)]
contact: Avoid unnecessary nation updates

Make setcont() update the nation only when it actually changes the
contact value.  For added benefit, map all non-zero values to one when
option LOSE_CONTACT is disabled.

This saves I/O, in particular xdump bandwidth.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
14 months agocontact: Inline putcontact() into its only caller setcont()
Markus Armbruster [Sun, 23 Oct 2016 15:52:17 +0000 (17:52 +0200)]
contact: Inline putcontact() into its only caller setcont()

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>