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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>
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>