]> git.pond.sub.org Git - empserver/log
empserver
12 years agoBetter diagnostics when build can't find suitable sectors
Markus Armbruster [Sat, 23 Apr 2011 09:11:23 +0000 (11:11 +0200)]
Better diagnostics when build can't find suitable sectors

Report "No sectors" when there are no *owned* sectors, instead of "Bad
sector specification" when there are no sectors at all.

12 years agoClean up buil()'s variable declarations
Markus Armbruster [Sat, 23 Apr 2011 08:51:35 +0000 (10:51 +0200)]
Clean up buil()'s variable declarations

12 years agoMake "build n" accept the optional tech argument
Markus Armbruster [Sat, 23 Apr 2011 08:15:16 +0000 (10:15 +0200)]
Make "build n" accept the optional tech argument

It has currently no real effect on the nuke built (nukes don't improve
with tech), but the special case is ugly, and is inconsistent with
info build.

12 years agoSimplify buil(): factor "can't build" handling out of switch cases
Markus Armbruster [Sat, 23 Apr 2011 07:22:00 +0000 (09:22 +0200)]
Simplify buil(): factor "can't build" handling out of switch cases

12 years agoSimplify buil(): factor getting third argument out of switch cases
Markus Armbruster [Sat, 23 Apr 2011 06:42:37 +0000 (08:42 +0200)]
Simplify buil(): factor getting third argument out of switch cases

12 years agoSimplify buil(): replace a switch by a function pointer
Markus Armbruster [Sat, 23 Apr 2011 06:34:35 +0000 (08:34 +0200)]
Simplify buil(): replace a switch by a function pointer

To enable that, make build_ship() & friends all take the same int type
argument instead of each one its own pointer.  Passing pointers
triggered "may be used uninitialized" compiler warnings (the code was
safe despite the warnings).

12 years agoDon't truncate research before multiplying with drnuke_const
Markus Armbruster [Sat, 23 Apr 2011 06:26:36 +0000 (08:26 +0200)]
Don't truncate research before multiplying with drnuke_const

For drnuke_const 0.33, research level 92.4 now suffices for a tech 280
nuke.  Before, you needed 93, which was inconsistent with what
version's promise "need 0.33 times the tech level in research".

12 years agoCreate nukes at the tech level permitted by research
Markus Armbruster [Sat, 23 Apr 2011 06:05:40 +0000 (08:05 +0200)]
Create nukes at the tech level permitted by research

The tech level is visible to players, but currently has no effect.

12 years agoBridge building required 0.005 tech less than advertized, fix
Markus Armbruster [Sat, 23 Apr 2011 06:03:17 +0000 (08:03 +0200)]
Bridge building required 0.005 tech less than advertized, fix

Has been that way since bridge building required tech.

12 years agoSimplify build_bridge(): replace a switch by a function pointer
Markus Armbruster [Sat, 23 Apr 2011 05:55:45 +0000 (07:55 +0200)]
Simplify build_bridge(): replace a switch by a function pointer

12 years agoFactor bridge building out of buil()
Markus Armbruster [Sat, 23 Apr 2011 05:50:32 +0000 (07:50 +0200)]
Factor bridge building out of buil()

Also avoids a "may be used uninitialized" compiler warning (the code
was safe despite the warning).

12 years agoMove bridge building functions together, rename
Markus Armbruster [Sat, 23 Apr 2011 05:46:54 +0000 (07:46 +0200)]
Move bridge building functions together, rename

Rename build_bridge() to build_bspan(), and build_tower() to
build_btower().

12 years agoCheck build's first argument before asking for the second
Markus Armbruster [Sat, 23 Apr 2011 05:19:55 +0000 (07:19 +0200)]
Check build's first argument before asking for the second

12 years agoImplement toggle techlists for show nuke
Markus Armbruster [Fri, 22 Apr 2011 18:00:26 +0000 (20:00 +0200)]
Implement toggle techlists for show nuke

This was probably neglected when the techlists feature was added in
v4.0.0, because compiled-in nukes were sorted by tech, unlike ships,
planes and land units.  Customization can break that.

12 years agoRewrite implementation of toggle techlists in show
Markus Armbruster [Fri, 22 Apr 2011 17:30:59 +0000 (19:30 +0200)]
Rewrite implementation of toggle techlists in show

To get rid of the ugly global variables.

Unlike before, the sort by tech is stable.

12 years agoFuse a few pr() in show_ship_stats() & friends
Markus Armbruster [Fri, 22 Apr 2011 16:11:29 +0000 (18:11 +0200)]
Fuse a few pr() in show_ship_stats() & friends

Also trim trailing space in output.

12 years agoBelatedly clean up after commit 3b4de2fe Remove option FUEL
Markus Armbruster [Fri, 22 Apr 2011 16:07:13 +0000 (18:07 +0200)]
Belatedly clean up after commit 3b4de2fe Remove option FUEL

12 years agoFix "show land s" to show columns xpl and lnd again
Markus Armbruster [Fri, 22 Apr 2011 16:06:33 +0000 (18:06 +0200)]
Fix "show land s" to show columns xpl and lnd again

Broken in commit 3b4de2fe, v4.3.15.

12 years agoFactor show_load() out of show_ship_capab(), show_land_capab()
Markus Armbruster [Fri, 22 Apr 2011 15:39:40 +0000 (17:39 +0200)]
Factor show_load() out of show_ship_capab(), show_land_capab()

12 years agoSimplify show_capab(), don't print trailing space
Markus Armbruster [Fri, 22 Apr 2011 15:35:23 +0000 (17:35 +0200)]
Simplify show_capab(), don't print trailing space

12 years agoFactor show_capab() out of show_ship_capab() & friends
Markus Armbruster [Fri, 22 Apr 2011 15:25:22 +0000 (17:25 +0200)]
Factor show_capab() out of show_ship_capab() & friends

13 years agoBump version to 4.3.28
Markus Armbruster [Fri, 22 Apr 2011 15:24:05 +0000 (17:24 +0200)]
Bump version to 4.3.28

13 years agoFix compile under Window MinGW environment v4.3.27
Ron Koenderink [Sun, 17 Apr 2011 21:43:55 +0000 (15:43 -0600)]
Fix compile under Window MinGW environment

Switch to __int64 from _int64.  Change the constant
declaration to use LL instead of a cast.

13 years agoClean up extra headline in info Bridges
Markus Armbruster [Sun, 17 Apr 2011 15:45:25 +0000 (17:45 +0200)]
Clean up extra headline in info Bridges

13 years agoUpdate info History and Overview to cover 1998-present
Markus Armbruster [Sun, 17 Apr 2011 15:09:44 +0000 (17:09 +0200)]
Update info History and Overview to cover 1998-present

13 years agoClean up info Bugs
Markus Armbruster [Sun, 17 Apr 2011 09:56:23 +0000 (11:56 +0200)]
Clean up info Bugs

Add bug reporting instructions.

Drop the bugs documented as fixed.  File was last changed in Empire 2,
so these have been fixed for a while...

Remaining bugs:

    The classification scheme used by report is dumb.

It still is.

    You can make a sector temporarily useless by filling up all its
    fields with delivery and distribution information.  This is useful
    when an enemy is trying to capture the sector (his mil don't have
    room to move in :-) You have to halt some of the deliveries or
    distributions to make room for the military to move in.  (Mostly
    fixed by changing the number of available fields)

Fixed since 4.2.14 eliminated `variables'.  Delete.

    Warehouses can't distribute all commodities simultaneously, due to
    limited fields for this information.  This becomes a problem if
    you have a countrywide network of warehouses distributing to each
    other.  (Mostly fixed by changing the number of available fields)

Fixed since 4.2.14 eliminated `variables'.  Delete.

    You can sometimes move small quantities of certain items from
    warehouses at no mobility cost, even into mountains (this is my
    favorite bug, I'd hate to see it fixed :-)

Feature; delete.

    Guerrillas don't seem to carry the plague.

They still don't.

    You can sometimes trick someone into paying a huge price for
    commodities by changing the price suddenly.  Therefore one should
    always check prices when buying commodities.

You can't increase prices anymore.  Delete.

    When two countries are attacking each other simultaneously, you
    can sometimes move into a sector he is in the process of
    attacking.  If you get the timing right, he will take the sector
    but you will get it back, along with all his military.

Can't reproduce; delete.

    If a plane is out to trade, and gets shot down, it can still be
    bought until the next update.  If another country builds a new
    plane that gets the number of the plane that was shot down, the
    new plane will go on the trading market automatically.  Then if
    that plane is bought, the money goes to the country whose plane
    was shot down, not the country that built the plane.  I stole
    numerous planes (including nuclear missiles :-) this way (by
    deliberately putting low numbered planes up for trade, then having
    them shot down).

Planes on a trading block can't get shot down, because they can't fly.
They can get destroyed on the ground, though.  A new plane with the
same number still goes on the market automatically.  Same for ships,
land units and nukes.  check_trade() deletes a trade when the object's
owner changed.  Reword the paragraph accordingly.

    If a plane has negative mobility, then gets traded, mobility goes to 0.

Still correct.

    Firing on sectors with land-locked sunken ships does strange
    things.

Can't reproduce; delete.

    If two countries are cooperating, its possible to raid an enemy
    airport and steal the planes by putting them out to trade.

Still correct.

    You can also strip enemy sectors of commodities using "sell", if
    you have military control temporarily.

Requires mobility now.  Delete.

    One can make work go back to 100 everywhere in a country by moving
    all civil- ians in low-work sectors onto a bridge, then collapsing
    the bridge.  Work then goes to 100 at the next update, if you
    leave some mil in the vacated sectors.  Or you can move mil out
    too, letting the sector ownership change to the Deity, then move
    back in from a 100% working sector, and work goes immediately to
    100.

Feature; delete.

    Two cooperative countries can move commodities around at no
    mobility cost using the market.

Still correct.

    You can collapse enemy bridges by making a lightning raid on his
    bridgeheads and redesignating them, even if you only hold the
    bridgehead for a short time.  (In this games, bridges work
    differently, see info build, info bridges")

Still correct.  The parenthesis is cryptic, though; delete it.

    You can map out enemy territory by raiding his radar stations.

Feature; delete.

    Condition checking is very treacherous.  Global commands with
    conditions are unreliable.  I never figured out exactly what was
    wrong, although I think your method of putting conditions towards
    the front of the line helped sometimes.

Can't reproduce; delete.

    You can have more than 26 ships in a fleet, but only the first 26
    will move when you navigate the fleet (I think 26 is the right
    number, but I'm not cer- tain.  It might be 32).

Can't reproduce; delete.

    "Look" only spots subs (from destroyers) at a certain distance.
    If you are too close you won't see them (unless you are in the
    same sector).

Can't reproduce; delete.

    You can only fly as many planes on a mission as you can fit on the
    command line (so low numbered planes have an advantage this way).
    USE WINGS

The real issue here is truncation of long input lines.  Replace.

    When a sector has a visible ship, radar doesn't show whether the
    sector is land or sea, just the ship.  This has interesting
    possibilities for exploita- tion (like land-locking a battleship
    in your capital in order to deceive the enemy :-)

Feature; delete.

    I don't think you can land planes on a land-locked aircraft
    carrier anymore.

Yes, you can.  Is that good or bad?  Anyway, delete.

    Its common to mistakenly set the price of a plane or ship
    incorrectly so one should check trade after using set.

Pilot error; delete.

    The "must be accepted by" date on offered loans is bogus.

Why is it bogus?  The date looks good to me.  The offer expires at
that time.  Delete.

    "Turn off" doesn't stop updates.

Feature; delete.

13 years agoUpdate change log again for 4.3.27
Markus Armbruster [Sun, 17 Apr 2011 09:42:04 +0000 (11:42 +0200)]
Update change log again for 4.3.27

13 years agoDon't .ds <= and >=, use \(<= and \)>= directly
Markus Armbruster [Sun, 17 Apr 2011 09:29:03 +0000 (11:29 +0200)]
Don't .ds <= and >=, use \(<= and \)>= directly

The symbols work fine even with CRT.MAC.  In fact, they've been used
by Food.t since Empire 2.

13 years agoClarify info turn: turn off doesn't disable updates
Markus Armbruster [Sun, 17 Apr 2011 09:23:50 +0000 (11:23 +0200)]
Clarify info turn: turn off doesn't disable updates

13 years agoBelatedly update designate's c_form
Markus Armbruster [Sun, 17 Apr 2011 09:21:47 +0000 (11:21 +0200)]
Belatedly update designate's c_form

Commit 8227d8c8 (v4.3.12) removed its optional argument without
updating c_form.

13 years agoMake option RAILWAYS disable rail infrastructure
Markus Armbruster [Sun, 17 Apr 2011 09:16:01 +0000 (11:16 +0200)]
Make option RAILWAYS disable rail infrastructure

Rail infrastructure isn't used with RAILWAYS.  Disable, to make the
improve command reject it.

13 years agoClean up mark()'s test for its optional argument
Markus Armbruster [Sun, 17 Apr 2011 07:53:40 +0000 (09:53 +0200)]
Clean up mark()'s test for its optional argument

Commit 60bbb6b0 (v4.2.15) accidentally changed the test from "absent
or empty" to "absent".  Leave it that way, just clean it up.

13 years agoFix buy not to wipe out concurrent updates
Markus Armbruster [Sun, 17 Apr 2011 04:44:21 +0000 (06:44 +0200)]
Fix buy not to wipe out concurrent updates

buy() reads the lot, prompts for input, then writes back the lot,
triggering a generation oops.  Any updates made by other threads while
buy() waits for input are wiped out, triggering a seqno mismatch oops.

Since commodities are taken from the seller when he puts them on the
market, and given to the buyer when the trade executes, the wiped out
lot's seller loses his goods without compensation, the other seller
gets to keep his goods, and the buyer receives their duplicates.

This can be abused by two conspiring countries to duplicate
commodities.  The seller puts them on the market (say 100 gold bars).
The buyer starts a buy command, and waits at its last prompt for the
lot to be replaced.  The seller takes them off the market (possible,
since there's no bid, yet), and sells something else (say one food)
quickly enough to get the same lot number assigned.  The buyer then
completes the buy command.  The seller loses one food, the buyer gains
100 gold bars.

Replaces a partial fix from v4.0.1, which only caught lots gone away,
not lots replaced by new ones.

13 years agoUse SECS_PER_DAY instead of literal 86400
Markus Armbruster [Sat, 16 Apr 2011 19:05:06 +0000 (21:05 +0200)]
Use SECS_PER_DAY instead of literal 86400

13 years agoDon't let planes on trading block intercept or interdict
Markus Armbruster [Sat, 16 Apr 2011 19:00:27 +0000 (21:00 +0200)]
Don't let planes on trading block intercept or interdict

Fighters, SAMs, ABMs and anti-sats could intercept, and tactical
missiles could interdict ships or land units.

Missed when the other missions were fixed in v4.2.7.

13 years agoFix setsector and setres not to wipe out concurrent updates
Markus Armbruster [Sat, 16 Apr 2011 18:34:26 +0000 (20:34 +0200)]
Fix setsector and setres not to wipe out concurrent updates

setsector() reads the sector, prompts for input, then writes back the
sector, triggering a generation oops.  Any updates made by other
threads while setsector() waits for input are wiped out, triggering a
seqno mismatch oops.

Same for setres().

13 years agoReduce massive code duplication in setsector(), setres()
Markus Armbruster [Sat, 16 Apr 2011 18:30:22 +0000 (20:30 +0200)]
Reduce massive code duplication in setsector(), setres()

There's the same sector loop in every switch case.  Loop around the
switch instead.

13 years agoMake info pray point to version (for e-mail) and flash
Markus Armbruster [Sat, 16 Apr 2011 13:53:01 +0000 (15:53 +0200)]
Make info pray point to version (for e-mail) and flash

13 years agoCommit 44db5453 added a FIXME comment accidentally, drop it
Markus Armbruster [Sat, 16 Apr 2011 12:50:51 +0000 (14:50 +0200)]
Commit 44db5453 added a FIXME comment accidentally, drop it

13 years agoCommit f04d1ae0 made journal escape '\t' again, fix
Markus Armbruster [Sat, 16 Apr 2011 11:25:47 +0000 (13:25 +0200)]
Commit f04d1ae0 made journal escape '\t' again, fix

13 years agoClean up write-only variable in path_find_to()
Markus Armbruster [Thu, 14 Apr 2011 19:20:09 +0000 (21:20 +0200)]
Clean up write-only variable in path_find_to()

13 years agoUpdate change log for 4.3.27
Markus Armbruster [Thu, 14 Apr 2011 18:54:16 +0000 (20:54 +0200)]
Update change log for 4.3.27

13 years agoClean up getcommand(): use sizeof() instead of literal 1024
Markus Armbruster [Thu, 14 Apr 2011 18:47:20 +0000 (20:47 +0200)]
Clean up getcommand(): use sizeof() instead of literal 1024

13 years agoFix client to log long input lines untruncated
Markus Armbruster [Thu, 14 Apr 2011 18:42:42 +0000 (20:42 +0200)]
Fix client to log long input lines untruncated

They can still get split by output arriving between two reads from
input, but that's unavoidable, because the client is designed to read
and write big chunks, not lines.

13 years agoFix client crash for long input lines
Markus Armbruster [Thu, 14 Apr 2011 05:48:14 +0000 (07:48 +0200)]
Fix client crash for long input lines

recv_input() misued lbuf_putc() and passed truncated lines without a
final newline to save_input(), failing the assertion in save_input().

13 years agoMark long info pages with `!' in subject pages
Markus Armbruster [Wed, 13 Apr 2011 17:50:31 +0000 (19:50 +0200)]
Mark long info pages with `!' in subject pages

13 years agoUpdate info version example to current output
Markus Armbruster [Wed, 13 Apr 2011 05:12:07 +0000 (07:12 +0200)]
Update info version example to current output

13 years agoRemove edit keys deprecated in 4.3.15, 4.3.17 and 4.3.20
Markus Armbruster [Tue, 12 Apr 2011 21:07:03 +0000 (23:07 +0200)]
Remove edit keys deprecated in 4.3.15, 4.3.17 and 4.3.20

These are: ship and land 'B', land 'P', and plane 'n'.

13 years agoUpdate known contributors comments
Markus Armbruster [Mon, 11 Apr 2011 20:40:57 +0000 (22:40 +0200)]
Update known contributors comments

13 years agoFix give not to wipe out concurrect updates
Markus Armbruster [Mon, 11 Apr 2011 19:52:10 +0000 (21:52 +0200)]
Fix give not to wipe out concurrect updates

give() reads the sector, prompts for input, updates the sector and
writes it back, triggering a generation oops.  Any updates made by
other threads during the yield are wiped out, triggering a seqno
mismatch oops.

13 years agoMake generation numbers catch more potential yields on input
Markus Armbruster [Mon, 11 Apr 2011 19:37:23 +0000 (21:37 +0200)]
Make generation numbers catch more potential yields on input

getstarg(), snxtitem() and snxtsct() can yield the processor, because
they call getstring().  But only for null or empty arguments.  For
other arguments, we should call ef_make_stale(), to catch errors.
Problem: if a caller never passes null or empty arguments, it may rely
on these functions not yielding.  We'd get false positives.  In
general, we can't know whether that's the case.  But we do know in the
common special case of player arguments.  Call ef_make_stale() for
those.

13 years agoDocument sequence numbers and generation numbers better
Markus Armbruster [Mon, 11 Apr 2011 19:21:19 +0000 (21:21 +0200)]
Document sequence numbers and generation numbers better

13 years agoSimplify map(): use getstarg() instead of getstring()
Markus Armbruster [Mon, 11 Apr 2011 17:49:10 +0000 (19:49 +0200)]
Simplify map(): use getstarg() instead of getstring()

13 years agoSimplify execute(): use getstarg() instead of getstring()
Markus Armbruster [Sun, 10 Apr 2011 18:00:32 +0000 (20:00 +0200)]
Simplify execute(): use getstarg() instead of getstring()

13 years agoClean up display_region_map()
Markus Armbruster [Sun, 10 Apr 2011 17:08:11 +0000 (19:08 +0200)]
Clean up display_region_map()

Without ARG1, display_region_map() formats a rectangular area around
CURX,CURY, so it can use do_map().  Ugly, and duplicates some
unit_map() functionality.

Factor snxtsct_around() out of unit_map().  Inline do_map() into
display_region_map(), so we can use snxtsct_around().

Don't mess with player->condarg.  Leftover from when we abused map()
here.

13 years agoFactor parse_map_arg() out of do_map()
Markus Armbruster [Sun, 10 Apr 2011 16:49:51 +0000 (18:49 +0200)]
Factor parse_map_arg() out of do_map()

13 years agoSwitch do_unit_move() over to display_region_map()
Markus Armbruster [Sun, 10 Apr 2011 16:38:03 +0000 (18:38 +0200)]
Switch do_unit_move() over to display_region_map()

Just to make it more obviously consistent with map() callbacks used
with move_ground().

13 years agoClean up move_ground()'s parsing of DIR_MAP
Markus Armbruster [Sun, 10 Apr 2011 16:09:16 +0000 (18:09 +0200)]
Clean up move_ground()'s parsing of DIR_MAP

Split with parse() and pass first two arguments instead of the raw
tail to the map() callback.  Advantages:

* Consistent with do_unit_move().

* Does the right thing when the tail is just spaces.  Before, the
  spaces got passed to the map() callback, which complained about
  syntax.  Now, they are ignored.  This is what the commit I just
  reverted tried to fix.

* Works better when the tail splits into more than two arguments.
  Except for explore_map(), which ignores the argument(s), the map()
  callbacks use display_region_map(), which split the tail at the
  first space, and complained about any spaces in the second part.
  Now, display_region_map() takes two argument strings instead of a
  single, unsplit argument string, and extra arguments get silently
  ignored, as usual.

13 years agoRevert "(move_ground): Passed junk to map callback when 'm' sub-command"
Markus Armbruster [Sun, 10 Apr 2011 12:51:03 +0000 (14:51 +0200)]
Revert "(move_ground): Passed junk to map callback when 'm' sub-command"

It ignores all embedded space, not just trailing space after 'm'.

This reverts commit f65b255d1871ea0a1fa87d6d87c527566e108b87.

13 years agoCollapse duplicated code in draw_map()
Markus Armbruster [Sun, 10 Apr 2011 08:16:59 +0000 (10:16 +0200)]
Collapse duplicated code in draw_map()

One loop for maps and one for bmaps suffice.  Before, we had two
similar ones for each.

13 years agoFix map drawing commands to report bad unit arguments
Markus Armbruster [Sun, 10 Apr 2011 07:14:29 +0000 (09:14 +0200)]
Fix map drawing commands to report bad unit arguments

Before, they failed without explanation when they interpreted the
argument as unit number, but the player didn't own that unit.

13 years agoChange unit_map() not to use RET_OK and RET_FAIL as return values
Markus Armbruster [Sun, 10 Apr 2011 07:11:20 +0000 (09:11 +0200)]
Change unit_map() not to use RET_OK and RET_FAIL as return values

Returning 0 and -1 is simpler.

13 years agoClean up bmap commands' flags argument
Markus Armbruster [Sun, 10 Apr 2011 05:43:04 +0000 (07:43 +0200)]
Clean up bmap commands' flags argument

parse_map_flags() silently truncates map flags after the first 't' or
'r'.  This makes it accept arguments "true" and "revert".  However, it
also breaks the perfectly sensible argument "ts", which should show
ships just like "st", but doesn't.

info bmap & friends document arguments "true" and "revert", and also
suggest flags 't' and 'r'.  What a mess.

Make argument "revert" a special case.  Deprecate flag 'r', and clean
up truncation there.

Don't truncate after flag 't'.  If any bad flags follow, ignore
everything after 't', but deprecate that usage.

13 years agoFactor parse_map_flags() out of do_map()
Markus Armbruster [Sun, 10 Apr 2011 05:27:23 +0000 (07:27 +0200)]
Factor parse_map_flags() out of do_map()

13 years agoFold draw_map() parameter bmap into map_flags
Markus Armbruster [Sun, 10 Apr 2011 05:18:53 +0000 (07:18 +0200)]
Fold draw_map() parameter bmap into map_flags

No functional change.

13 years agoTweak info on movement commands' map drawing sub-commands
Markus Armbruster [Sat, 9 Apr 2011 18:49:35 +0000 (20:49 +0200)]
Tweak info on movement commands' map drawing sub-commands

13 years agoFail map drawing command when player doesn't confirm bmap revert
Markus Armbruster [Sat, 9 Apr 2011 18:39:34 +0000 (20:39 +0200)]
Fail map drawing command when player doesn't confirm bmap revert

Doesn't affect mapping at movement prompts (navigate, march, move,
test and transport), because the failure is ignored there.

13 years agoDon't show a map on bmap revert
Markus Armbruster [Sat, 9 Apr 2011 18:34:22 +0000 (20:34 +0200)]
Don't show a map on bmap revert

Before, it showed a map, but only when the player confirmed the
revert.

13 years agoClean up map info pages a bit
Markus Armbruster [Sat, 9 Apr 2011 18:19:15 +0000 (20:19 +0200)]
Clean up map info pages a bit

Drop .SY for map commands other than the one documented by the info
page.

Use the page's command to discuss arguments "revert" and "true", not
"bmap".

Clarify flags argument.

13 years agoDrop useless checks for player->aborted in draw_map()
Markus Armbruster [Sat, 9 Apr 2011 13:36:40 +0000 (15:36 +0200)]
Drop useless checks for player->aborted in draw_map()

player->aborted gets set when we get an interrupt or EOF cookie from
the player, when update or shutdown abort commands, and when we abort
an attack (not relevant here).

The checks are useless: player interrupt and EOF are checked
elsewhere, and update/shutdown can run only when we yield the
processor, which we never do (output doesn't yield because C_MOD is
set).

13 years agoDrop potentially misleading build and radar error messages
Markus Armbruster [Sat, 9 Apr 2011 13:36:21 +0000 (15:36 +0200)]
Drop potentially misleading build and radar error messages

buil() complains about the argument when snxtsct() fails.  Misleading
when the argument is fine, but snxtsct() fails due to bad conditional
argument.

Same for radar() with snxtitem().

13 years agoRemove disabled command cede
Markus Armbruster [Sat, 9 Apr 2011 13:31:04 +0000 (15:31 +0200)]
Remove disabled command cede

It misuses snxtsct() and snxtitem() to find out whether the first
argument looks like sectors or like ships, which doesn't work with a
bad conditional argument.

Not worth fixing now; it's been disabled since 4.0.1, and broken at
least since commit 2fc1e74a (v4.3.0) broke its sector/ship
disambiguation via third argument.

13 years agoFix do_map()'s misuse of snxtsct() for testing argument syntax
Markus Armbruster [Sat, 9 Apr 2011 12:57:42 +0000 (14:57 +0200)]
Fix do_map()'s misuse of snxtsct() for testing argument syntax

It assumes snxtsct() fails only when the argument can't be parsed.  It
can also fail when the condition argument has errors.  `map # ?xxx'
first complains about xxx, then maps around ship#0.  Broken since
Chainsaw 2 introduced smap, pmap and lmap.

Use sarg_type() to recognize sectors vs. unit argument.  `map # ?xxx'
now fails as it should.

Subtle side effect: do_map() no longer prompts for argument "",
because snxtsct() is now guarded by sarg_type().  Impact on callers:

* display_region_map() is not affected, because it never passes "".

* map() passes on "" arguments.  Change it to prompt in that case.
  Consistent with how other commands behave.  No functional change.

* do_unit_move() passes on "" arguments.  Keep it that way.  This
  changes navigate and march sub-commands 'M' and 'B' not to prompt
  for "" arguments, which is consistent with sub-command 'm' of move,
  test and transport.

13 years agoMake map drawing commands fail on bad flags
Markus Armbruster [Sat, 9 Apr 2011 08:39:12 +0000 (10:39 +0200)]
Make map drawing commands fail on bad flags

Also affects mapping at movement prompts of navigate, march, move,
test, transport.

13 years agoMove function declarations for maps.c from prototypes.h to map.h
Markus Armbruster [Sat, 9 Apr 2011 07:28:58 +0000 (09:28 +0200)]
Move function declarations for maps.c from prototypes.h to map.h

13 years agoMove map flags from map.h to maps.c, and reorder
Markus Armbruster [Sat, 9 Apr 2011 06:56:01 +0000 (08:56 +0200)]
Move map flags from map.h to maps.c, and reorder

Not useful elsewhere.  Since I'm touching them anyway, put them in the
usual ship, plane, land, nuke order.

13 years agoRemove misleading comment on MAP_PLANE & friends
Markus Armbruster [Sat, 9 Apr 2011 06:40:33 +0000 (08:40 +0200)]
Remove misleading comment on MAP_PLANE & friends

ef_unit_list doesn't exist.  Order doesn't matter, priority is defined
by draw_map()'s ef_unit_map[].

This reverts commit 9e75e5e0094a518ba7445b4fd278aca09c6830c0.

13 years agoDrop "xdump ver" deprecated in 4.3.12
Markus Armbruster [Sat, 9 Apr 2011 06:01:58 +0000 (08:01 +0200)]
Drop "xdump ver" deprecated in 4.3.12

13 years agoinfo xdump still has long gone pseudo-table ver, remove
Markus Armbruster [Sat, 9 Apr 2011 05:59:19 +0000 (07:59 +0200)]
info xdump still has long gone pseudo-table ver, remove

Missed in commit da8a1dae, v4.3.12

13 years agoMove xdmeta() back to commands/xdump.c, internal linkage
Markus Armbruster [Sat, 9 Apr 2011 05:39:58 +0000 (07:39 +0200)]
Move xdmeta() back to commands/xdump.c, internal linkage

Partially revert commit 4c746b5e.

13 years agoSimplify satmap() with snxtitem_use_condarg(), snxtsct_use_condarg()
Markus Armbruster [Fri, 8 Apr 2011 19:15:05 +0000 (21:15 +0200)]
Simplify satmap() with snxtitem_use_condarg(), snxtsct_use_condarg()

13 years agoFactor snxtsct_use_condarg() out of snxtsct()
Markus Armbruster [Fri, 8 Apr 2011 19:13:07 +0000 (21:13 +0200)]
Factor snxtsct_use_condarg() out of snxtsct()

13 years agoFactor snxtitem_use_condarg() out of snxtitem()
Markus Armbruster [Fri, 8 Apr 2011 19:11:34 +0000 (21:11 +0200)]
Factor snxtitem_use_condarg() out of snxtitem()

13 years agoFix satellite to fail on bad conditional
Markus Armbruster [Fri, 8 Apr 2011 19:06:56 +0000 (21:06 +0200)]
Fix satellite to fail on bad conditional

snxtsct() and snxtitem() fail when the condition argument is bad.
satmap() didn't check for failure.  Due to the way snxtsct() and
snxtitem() work, bad condition arguments were reported and otherwise
ignored.

13 years agoCollect nstr_item, nstr_sect function declarations in nsc.h
Markus Armbruster [Fri, 8 Apr 2011 18:42:16 +0000 (20:42 +0200)]
Collect nstr_item, nstr_sect function declarations in nsc.h

Moved from prototypes.h.

13 years agoMove xysize_range(), xydist_range() to xy.c and xy.h
Markus Armbruster [Fri, 8 Apr 2011 18:38:03 +0000 (20:38 +0200)]
Move xysize_range(), xydist_range() to xy.c and xy.h

Moved from snxtsct.c and prototypes.h next to the other struct range
functions.

13 years agoFix journal.c boilerplate comment
Markus Armbruster [Mon, 4 Apr 2011 17:58:47 +0000 (19:58 +0200)]
Fix journal.c boilerplate comment

13 years agoNew journal event "output"
Markus Armbruster [Mon, 4 Apr 2011 06:09:25 +0000 (08:09 +0200)]
New journal event "output"

Redundant information, but incredibly useful when you want to figure
out what happened without a (still nonexistent) journal replay tool.
The redundancy could help making a journal replay tool more robust.

To enable, set econfig key keep_journal to at least 2.  Output events
are *not* flushed to disk immediately.

13 years agoFix journal not to truncate long lines
Markus Armbruster [Mon, 4 Apr 2011 06:00:08 +0000 (08:00 +0200)]
Fix journal not to truncate long lines

Could happen only for input events.

13 years agoEscape '\\' in journal, but not '\t'
Markus Armbruster [Mon, 4 Apr 2011 05:59:25 +0000 (07:59 +0200)]
Escape '\\' in journal, but not '\t'

13 years agoJournal login phase input, too
Markus Armbruster [Mon, 4 Apr 2011 05:58:08 +0000 (07:58 +0200)]
Journal login phase input, too

13 years agoNew journal event "command"
Markus Armbruster [Sun, 3 Apr 2011 06:27:30 +0000 (08:27 +0200)]
New journal event "command"

Redundant information.  Allows making sense of input without context.
The redundancy could help making a journal replay tool more robust.

13 years agoClean up superfluous include of queue.h in land.h, ship.h
Markus Armbruster [Sun, 3 Apr 2011 09:20:06 +0000 (11:20 +0200)]
Clean up superfluous include of queue.h in land.h, ship.h

13 years agoClean up superfluous include of nsc.h in prototypes.h
Markus Armbruster [Sun, 3 Apr 2011 08:41:10 +0000 (10:41 +0200)]
Clean up superfluous include of nsc.h in prototypes.h

13 years agoClean up superfluous include of news.h in empobj.h
Markus Armbruster [Sun, 3 Apr 2011 08:36:46 +0000 (10:36 +0200)]
Clean up superfluous include of news.h in empobj.h

Missed in commit 0ba61f17, v4.3.24.

13 years agoDisable BRIDGETOWERS by default
Markus Armbruster [Sat, 2 Apr 2011 12:41:09 +0000 (14:41 +0200)]
Disable BRIDGETOWERS by default

A deity can easily break BRIDGETOWERS by reducing etu_per_update
without compensating customization of buil_tower_bh,
rollover_avail_max or bridge span maxpop.

Document the issue in output of pconfig (which is installed as
$prefix/etc/empire/econfig).

To increase the chance deities actually read the documentation,
disable BRIDGETOWERS.

13 years agoReduce bridge tower materials from 400 to 300 hcms.
Markus Armbruster [Sat, 2 Apr 2011 12:20:54 +0000 (14:20 +0200)]
Reduce bridge tower materials from 400 to 300 hcms.

Bridge spans have been unable to produce enough avail for a tower with
default game configuration since we reduced their maximum population
in commit 6bbd7ffd, v4.3.6.  This commit reduces required avail from
160 to 120, fixing the stock game: 100 civilians and 100 uws can make
that much in a 60 ETU update.

13 years agoFix stop orders to expire even when the country is broke
Markus Armbruster [Tue, 29 Mar 2011 18:09:56 +0000 (20:09 +0200)]
Fix stop orders to expire even when the country is broke

Broken in commit 8da88626, v4.3.8.

13 years agoFix march and navigate not to interpret coordinates as path
Markus Armbruster [Sun, 27 Mar 2011 15:55:35 +0000 (17:55 +0200)]
Fix march and navigate not to interpret coordinates as path

Destination arguments can be a path or sector coordinates.
do_unit_move() passes the argument buffer to unit_path() to convert
coordinates to a path.  If unit_path() fails, do_unit_move() still
interprets the argument as path.

This is correct when unit_path() fails because the argument is not
coordinates.  But it can also fail when it is coordinates, namely when
the destination isn't reachable, when the path to it is too long, or
when the ships or land units aren't together.  Then do_unit_move()
interprets coordinates as path, and rejects them with "Legal
directions are:".

Except when a land unit's destination read from a march prompt isn't
reachable, because then unit_path() empties the argument buffer that
do_unit_move() uses.

Change unit_path() to succeed when the argument is not coordinates.
Make do_unit_move() discard the argument when unit_path() fails,
i.e. when it is bad coordinates.  unit_path() emptying the argument no
longer has an effect, drop it.

13 years agoClean up path finding in perform_mission_bomb()
Markus Armbruster [Sun, 27 Mar 2011 08:08:16 +0000 (10:08 +0200)]
Clean up path finding in perform_mission_bomb()

Support missions up to 1023 sectors away from the airfield, up from
99.

Don't bother to call mapdist() for distance to target, just use the
path length.