Commit graph

1163 commits

Author SHA1 Message Date
e60f0be73f emp_config: Don't monkey-patch WORLD_X to be even
emp_config() silently truncates WORLD_X to even.  Drop that.  We could
flag odd WORLD_X as error, but we don't validate the other
configuration values, so why this one?  Instead document it needs to
be even.  WORLD_Y, too.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:52 +01:00
fff476ac4b retreat: Fix group retreat after failed board sinks ship
Group retreat still doesn't work, because when boar() passes a sunk
ship to retreat_ship(), its owner has been reset to POGO already.
This makes it impossible to find the group to retreat.  Instead, it
attempts to retreat ships that sank in the same sector with group
retreat orders and with the same fleet letter assigned.  If any exist,
shp_may_nav() oopses, and prevents actual retreat of these ghosts.

The other retreat conditions don't have this problem, because they
call putship(), which resets the owner, only after retreat_ship().

Making boar() work the same is not practical.  Instead, add an owner
parameter to retreat_ship(), and for symmetry also to retreat_land().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:51 +01:00
c8e5b4fc50 subs: De-duplicate formatting in intelligence_report()
Every piece is formatted either with pr(), or with sprintf() for later
sending with wu().  The output is actually identical.  Format with
sprintf() always, and then either pr() or wu() the results.

While there, change the first parameter's type from int to natid.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:50 +01:00
820d755e59 subs: Change pln_damage()'s parameter noisy to string prefix
No functional change for now.  The next commit will put it to use.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:50 +01:00
e92a522731 symbol: New symbol_set_fmt() parameter sep, use for show
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:49 +01:00
9fc0719e54 symbol: Make actofgod.c's fmtflags() public as symbol_set_fmt()
Move to nstreval.c, rename, external linkage.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:49 +01:00
67fe316c0c bomb: Fix ship list header for ASW planes
The code to list ships got triplicated in Chainsaw.  Empire 2 screwed
up one copy in its global replace of owner by player->owner.

Fix it by de-duplicating.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:49 +01:00
beedf8dced retreat: Rewrite automatic retreat code to fix its many bugs
Much of the retreat code duplicates navigate and march code.  Worse,
retreat's version is full of bugs:

* Land units can sometimes retreat when they couldn't march: while on
  the trading block (forbidden with march since 4.0.9), crewless
  (likewise since 4.0.0), kidnapped in a foreign sector (inconsistent
  since land units were added in Chainsaw 3), loaded on a ship
  (likewise) or a land unit (inconsistent since trains were added in
  4.0.0).

* Ships can retreat while on the trading block (forbidden with
  navigate since 4.0.9)

* Land units can't retreat into foreign sectors even though they could
  march there, namely when sector is allied or the land unit is a spy.
  They can march there since 4.0.0.

* Land units keep their fortification on retreat.  Has been that way
  since retreat was added in Chainsaw.

Then there's group retreat.  It's basically crazy:

* It triggers retreat for everyone in the same fleet or army, one
  after the other, regardless of retreat path, conditions (including
  group retreat), or even location.  The latter is quite abusable
  since retreats aren't interdicted.  Has been that way since retreat
  was added in Chainsaw.

* Group retreat fails to trigger when the originally retreating ship
  or land unit has no retreat path left when it's done.  Broken in
  commit b860123.

Finally, the reporting to the owner is sub-par:

* When a retreat is cut short by insufficient mobility or
  obstructions, its end sector isn't reported, leaving the player
  guessing.

* Non-retreats can be confusingly reported as retreat to the same
  sector.  Can happen when the retreat path starts with 'h' (obscure
  feature to suppress a single retreat), or when a group retreat
  includes a ship or land unit without retreat orders.

* Interaction with mines during retreat is reported before the retreat
  itself, which can be quite confusing.

* Sweeping landmines isn't reported at all.

* Much code and much bulletin text is dedicated to reporting what
  caused the retreat, even though it should be perfectly obvious.

Rewrite this on top of common navigate and march code.  Reuse of
common code fixes the "can retreat when it couldn't navigate/march"
and the "can't retreat into sectors it could navigate or march into"
bugs, and improves the reporting.

One special case isn't a bug fix but a rule change: mountains.  The
old code forbids that explicitly, and it's clearly intentional, if
undocumented.  The new code allows it by not doing anything special.

Turn group retreat into an actual group retreat: everyone in the same
fleet and sector with the the same retreat path and group retreat
condition joins the group.  The group retreats together, just like in
navigate and march.

Take care to always report the end sector.  When retreat is
impossible, report "can't retreat".  When retreat is partial, report
"and stays in X,Y".  When it's complete, report "stopped at X,Y".

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:48 +01:00
74a71aa007 subs: Rename shp_nav(), lnd_mar()
... to shp_nav_stay_behind(), lnd_mar_stay_behind(), to better reflect
their purpose.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:47 +01:00
24000b4855 navigate march: Fix use-after-free and other bugs
unit_move() is too big and has too many paths through its loop.
Maintenance of the (unspoken) loop invariant isn't obvious.  In fact,
it isn't maintained on some paths.  I found several bugs:

* We check prerequisite conditions for moving before the first move
  and around prompts.  When a condition becomes wrong on the move,
  movement continues all the same until the next prompt.  I believe
  the only way this can happen is loss of crew due to hitting a mine.

* We cache ships and land units in a list of struct ulist.  When a
  ship or land unit gets left behind, its node is removed from the
  list and freed.

  We keep pointer flg pointing to the flagship in that list for
  convenience.  However, the pointer isn't updated until the next
  prompt.  It's referenced for automatic radar and all sub-commands
  other than the six directions and 'h'.  Use after free when such a
  sub-command gets processed after a flagship change without a prompt.
  Same for land units.  For instance, navigating a pair of ships "jh"
  where the flagship has no mobility leaves the flagship behind, then
  attempts to radar automatically using the ship in the freed list
  node.  Likewise, marching a similar pair of land units "jl" examines
  the land unit in the freed list node to figure out how to look.

* We cache mobility in the same list to support fractional mobility
  during movement.  Movement deducts from cached mobility and writes
  the result back to the ship or land unit.

  If something else charges it mobility while it's in this list, the
  cache becomes stale.  shp_nav() and lnd_nav() reload stale caches,
  but don't run often enough.  For instance, when a ship hits mines,
  the mine damage makes the cache stale.  If a direction or 'h'
  follows directly, the stale mobility is written back, clobbering the
  mine hit's mobility loss.

This mess dates back to Empire 2, where it replaced a different mess.
There may be more bugs.

unit_move()'s complex control flow makes reasoning about its loop
invariant too error-prone.  Rewrite the mess instead, splitting off
sensible subroutines.

Also fixes a couple of minor annoyances:

* White-space can confuse the parser.  For instance, "jg l" is
  interpreted like "jgll".  Fix to reject the space.  Broken in commit
  0c12d83, v4.3.7.

* The flagship uses radar automatically before any sub-command (since
  Chainsaw), and all ships use it automatically after a move (since
  4.2.2).  Make them all use it before and after each sub-command,
  whether it's a move or not.

* Land units don't use radar automatically.  Make them use it just
  like ships.

* Always report a flagship / leader change right when it happens, not
  only before and after a prompt.

Left for another day, marked FIXME: BTU charging is unclean.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:47 +01:00
198e2dd076 subs: Move shared code from navi.c to subs
Rename do_unit_move() to unit_move() to blend into unitsub.c.  Give
its helpers static linkage.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-03-02 08:20:47 +01:00
5c185a1507 subs: Factor lnd_may_mar() out of lnd_mar()
lnd_may_mar() uses lp->lnd_own rather than actor, but that's okay,
lnd_mar() ensures they're the same.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:21:35 +01:00
2a23660e68 subs: Factor shp_may_nav() out of shp_nav()
shp_may_nav() uses sp->shp_own rather than actor, but that's okay,
shp_nav() ensures they're the same.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:21:35 +01:00
2294785412 bomb fire launch torpedo: Don't disclose ship sinking in retreat
These commands report "sunk!" even when the ship survives the attack
but sinks during retreat.  bomb even reports where on the retreat the
ship sinks.  Has been that way since retreat was added in Chainsaw.

Report "sunk!" only when the attack sinks the ship directly.

Similar code exists for land units, but it doesn't report killings.
Change it anyway, to keep it consistent with the ship code.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:21:35 +01:00
b14f5276ab Update copyright notice
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:21:34 +01:00
f1042f82f1 march attack assault: Hit mines like ships do
When ships enter a sector with sea mines, any minesweepers sweep, then
hit mines, and finally all ships (including the minesweepers) hit
mines.  Sweeping in a sector (navigate sub-command 'm') works the same
without the final step.

When land units enter a sector with land mines, any engineers sweep,
and then all land units (including the engineers) hit mines.  Sweeping
in a sector (march sub-command 'm') works the same, which means
non-engineers can hit mines then.  Broken in Empire 2.

Actually broken for ships too then.  4.0.17 fixed ships, but neglected
to fix land units.

Change the land unit code to work like the ship code.  Fixes march
sub-command 'm' not to expose non-engineers to mines.  Changes march,
attack and assault with option INTERDICT_ATT enabled to expose
engineers twice.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:15 +01:00
1702349e3d unit: Drop ulist member chrp
Commit cd8d742 mechanically combined struct mlist's mcp and struct
llist's llp into struct ulist's chrp, adding type casts to every use.
Not necessary, simply use mchr[] and lchr[] directly.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:15 +01:00
4bc51f75f8 subs: Drop unit_path() parameter together
It's always non-zero now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:15 +01:00
6502ac2a8f navigate march: Drop do_unit_move() parameter together
It's always non-zero now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
a024dbb8a3 navigate: Require all ships to start in the same sector
The capability to navigate ships spread over several sectors is
obscure and rarely useful.  Accidental use is probably more frequent
than intentional use.  Issues:

* Interactive prompts show only the flagship's position, and give no
  clue that some ships are actually elsewhere.

* Path finding is supported only when all navigating ships are in
  the same sector.

* Interdiction becomes rather complex.  For each movement, every
  sector entered is interdicted independently.  This means the same
  fort, ship, land unit or plane can interdict multiple times.
  Interdiction order depends on the order the code examines
  ships. which the player can control.  This is all pretty much
  undocumented.

* Complicates the code and its maintenance.  Multiplies the number of
  test cases needed to cover navigate.

I feel we're better off without this feature.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
69c99a0f29 march: Require all land units to start in the same sector
The capability to march land units spread over several sectors is
obscure and rarely useful.  Accidental use is probably more frequent
than intentional use.  Issues:

* Interactive prompts show only the leader's position, and give no
  clue that some land units are actually elsewhere.

* Path finding is supported only when all marching land units are in
  the same sector.

* In each step, the bmap is updated for the leader's radar.  The bmap
  is not updated around other marching land units.  Already odd when
  all units are in the leader's sector, and odder still when some are
  elsewhere.

* Interdiction becomes rather complex.  For each movement, every
  sector entered is interdicted independently.  This means the same
  ship, land unit or plane can interdict multiple times.  Interdiction
  order depends on the order the code examines land units. which the
  player can control.  This is all pretty much undocumented.

* Complicates the code and its maintenance.  Multiplies the number of
  test cases needed to cover march.

I feel we're better off without this feature.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
5d0faf7a88 subs: Drop has_units() parameter lp, it's always null now
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
7c1b1661f5 march: Check for sector abandonment before anyone marches
Unlike the move command, march checks sector abandonment before every
step.

If the player declines, the last land unit stays put and is removed
from the march.

Except when sectors or land units change while we're waiting for the
player's reply.  Then the last unit is not removed from the march.
This can scatter land units.  Screwed up when checking for abandoning
the sector was added in 4.2.2.

Change march to work like move, and to avoid scattering land units: if
the player declines to abandon the sector, the command simply fails.

Put the check into new lnd_abandon_askyn().

Extend would_abandon() and want_to_abandon() from a single land unit
to many.  Rename the latter to abandon_askyn() for consistency.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
3b9f2a149b subs: Move sector abandonment functions to control.c
Move them out of commands/move.c, because they're the only thing
involving land units there.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
4f83ce27b4 gen: New emp_quelen(), replacing open-coded counting loops
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
9b33a4c598 subs: Add unitsatxy() parameter only_count
Like shipsatxy().  To be used shortly.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:13:14 +01:00
c70d9375ef subs: Make shp_check_nav() more like lnd_check_mar()
No functional change.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:12:54 +01:00
f0e6551461 subs: Factor lnd_check_mar() out of lnd_mar_one_sector()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:12:54 +01:00
6e386d101a subs: Give shp_nav_put(), lnd_mar_put() internal linkage
With autonav and SAIL gone, shp_nav_put() isn't used externally
anymore.  lnd_mar_put() never was; it got external linkage just for
symmetry.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:12:02 +01:00
dc73207a99 sail: Remove option SAIL
SAIL has issues:

* Sail orders are executed at the update.  Crafty players can use them
  to get around the update window.

* The route is fixed at command time.  You can't let the update find
  the best route, like it does for distribution.

* The info pages documenting it amount to almost 100 non-blank lines
  formatted.  They claim you can follow friendly ships.  This is
  wrong.  They also show incorrect follow syntax.  Unlikely to be the
  only errors.

* Few players use it.  Makes it a nice hidey-hole for bugs.  Here are
  two nice ones:

  - If follow's second argument is negative, the code attempts to
    follow an uninitialized ship.  Could well be a remote hole.

  - If ship #1 follows #2 follows #3 follows #2, the update goes into
    an infinite loop.

* It's more than 500 lines of rather crufty code nobody wants to
  touch.  Thanks to a big effort in Empire 2, it shares some code with
  the navigation command.  It still duplicates other navigation code.
  The sharing complicates fixing the bugs demonstrated by
  navi-march-test.

Reviewing, fixing and testing this mess isn't worth the opportunity
cost.  Remove it instead.  Drop commands follow, mquota, sail and
unsail.  Drop ship selectors mquota, path, follow.

struct shpstr shrinks some more, on my system from 160 to 120 bytes.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:11:28 +01:00
48e656c057 autonav: Remove the feature
The autonavigation feature has issues:

* Autonavigation orders are executed at the update.  Crafty players
  can use them to get around the update window.

* Usability is poor:

  - The order command is overly complex, not least because it can do
    five different things: clear, suspend, resume, declare route, set
    cargo levels.

  - Unlike every other command involving movement, order does not let
    you specify routes, only destination sectors.

  - Setting cargo levels can silently swap start and end point of a
    circular route, because "this keeps the load_it() procedure
    happy".  Maybe it does, but it surely keeps players confused.

  - Setting "start" cargo levels actually sets the "end" levels, and
    vice versa.  Has always been broken that way.

  - Predicting what exactly autonavigation will do at the update isn't
    easy.

* The info pages documenting it amount to almost 400 non-blank lines
  formatted.  They claim only merchant ships can be given orders.
  This is wrong.  Unlikely to be the only error.

* Few players use it, and its workings at the update a fairly opaque.
  Makes it a nice hidey-hole for bugs.  Here are two:

  - Unlike the scuttle command, autonavigation happily scuttles trade
    ships while they're on the trading block.

  - Unlike the load command, autonavigation can load in friendly and
    allied sectors.

* It's more than 700 lines of rather crufty code nobody wants to
  touch.  Thanks to a big effort in Empire 2, it shares code with the
  navigation command.  It still duplicates load code.  The sharing
  complicates fixing the bugs demonstrated by navi-march-test.

Reviewing, fixing and testing this mess isn't worth the opportunity
cost.  Remove it instead.  Drop commands order, qorder and sorder.
Drop ship selectors xstart, xend, ystart, yend, cargostart, cargoend,
amtstart, amtend, autonav.

xdump ship sheds almost half its columns.  struct shpstr shrinks, on
my system from 200 to 160 bytes.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-28 16:10:22 +01:00
f4f048234c empdump: Omit redundant data from export, new -c includes it
Cuts size of export files in test suite by a factor of four.  Not a
big deal for disk usage, as export files compress very well, and disk
space is cheap anyway.  Export files are simply easier to work with
when they aren't full of redundant crap.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:53:00 +01:00
7d3a3df283 file: New ef_typedstr_eq(), factored out of obj_changed()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:53:00 +01:00
e70d8f07f9 file: Rename struct emptypedstr to ef_typedstr
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:53:00 +01:00
41f00fdd33 nsc: Turn NSC_HIDDEN into a flag
More general, and fewer places need to know about it.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:52:59 +01:00
b6775d1c9b nsc: Turn common patterns into CA_IS_ARRAY() and CA_ARRAY_LEN()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:52:59 +01:00
143a4e4e6f nsc: Rename nstr_exec_val() to nstr_eval() and tighten contract
nstr_exec_val() can produce three different error values: NSC_NOTYPE
on invalid category, invalid type with zero val_as.lng on invalid type
(this is a bug), and the wanted type with zero val_s when it can't
coerce.  None of these should ever happen.

Fix it to always produce an NSC_NOTYPE error value.  Fix up callers to
check for it.

Specify the result's type is promoted on success.  Ensure it is even
when the argument is NSC_VAL with an unpromoted type, which is
invalid.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:52:59 +01:00
9a6998882a file: Provide EF_WITH_CADEF_MAX_ENTRY_SIZE to clean up xditem()
xditem() needs a buffer that can hold entries of any xdumpable table.
It's been 2048 bytes and marked FIXME since day one.  Clean it up so
that if anyone ever goes crazy with entry sizes, we fail an assertion
during startup instead of overrunning the buffer during play.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:52:59 +01:00
9ef4f1bf50 player: Drop long-disabled code to resolve IP addresses
Disabled since commit 32fac04 (v4.2.13) because it could at the time
use more stack space than we provided.  Additional issues: code still
uses obsolete gethostbyaddr() rather than getnameinfo(), and we
provide only 512 bytes for host names instead of the customary
NI_MAXHOST (1025) bytes.

All three issues would be easy enough to fix.  What's not so easy is
to avoid blocking on the synchronous DNS lookup.  Without that,
connecting repeatedly from a range of addresses with slow reverse
lookup could conceivably be employed as a denial of service attack.

We've been living without reverse lookup for close to ten years.  Bury
the corpse, and move on.

Bonus: sizeof(struct natstr) is cut in half.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:52:59 +01:00
002a3a3f1e xundump: Refuse to undump strings too long for terminating null
We're dealing with three kinds of string storage: char * pointing to a
null-terminated string, char[] holding a null-terminated string, and
char holding a string of length 0 or 1.

Unfortunately, xdump meta data doesn't distinguish the latter two:
both are NSC_STRINGY.  Because of that, xundump happily fills char[]
to the limit, producing strings that aren't null-terminated, resulting
in read beyond buffer and possibly worse.

Affects struct shpstr members shp_path, shp_name, shp_rpath, struct
lndstr member lnd_rpath, and struct natstr members nat_cnam, nat_pnam,
nat_hostaddr, nat_hostname, nat_userid.  Since these are all in game
state, only the empdump utility program is affected, not the
configuration table reader.

We clearly need to require null-termination for char[] values.  Since
using char[1] for null-terminated strings makes no sense, we can still
make NSC_STRINGY with length 1 serve char values as before, by
permitting non-null-terminated strings only when length is 1.  Ugly
wart, but it fixes the bug without a possibly awkward change xdump
meta-data.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-02-01 16:52:58 +01:00
56cadfe157 subs: Rename lnd_delete() to lnd_put_one()
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-01-17 15:25:24 +01:00
7548337e73 subs: Rename shp_put() to shp_nav_put()
For consistency with lnd_mar_put().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-01-17 15:25:24 +01:00
18bf9e0b34 subs: Split lnd_mar_put() off lnd_put() and specialize
lnd_put() serves two masters: march, which wants it to report
"stopped" and write back struct ulist member mobility to
unit.land.lnd_mobil, and ground combat, which doesn't.

lnd_put() assumes march when actor is non-zero.  Correct (but see
commit 8c502d4).  Dates back to Empire 2.

Too ugly for my taste.  Specialize for each master instead:
lnd_mar_put() for march, and lnd_put() for ground combat.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-01-17 15:25:23 +01:00
b5ffc1ca49 subs: Split unit_put() into shp_put() and lnd_put() again
Commit d94d269 combined them into unit_put(), but that has turned out
not to be useful.  Split them again.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-01-17 15:25:16 +01:00
62b9399cdf subs: Factor lnd_insque() out of lnd_sel(), ask_olist(), ...
... get_dlist(), att_reacting_units().

This loses malloc() error checking in ask_olist() and get_dlist().  No
great loss, because we don't check in so many other places, including
att_reacting_units().  We should use a wrapper that terminates on
error, though.  Left for another day.

ask_olist(), get_dlist() and att_reacting_units() zero the struct
ulist with memset().  lnd_insque() doesn't, so these functions need to
zero any members not otherwise initialized explicitly now.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-01-14 19:08:47 +01:00
5c9d6063a4 unit: Fix comments on struct ulist member use
Members x, y, eff, supplied are not "LAND only", they're used only by
ground combat.  They're not used by march.

In ground combat, member mobil is not how much the land unit has left,
it's how much it still needs to be charged.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-01-14 19:08:46 +01:00
fe42e6e8dd subs: Factor shp_insque() out of shp_sel(), shp_missdef(), ...
... nav_ship(), fltp_to_list().

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2015-01-14 19:08:46 +01:00
76ca2011c3 trade: Clean up type of trdswitchown()'s second parameter
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-02-16 13:19:27 +01:00
5cbcdc0497 Clean up superfluous includes
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-02-16 13:19:26 +01:00
3b6f3a5516 retreat: Move function declarations to retreat.h
Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
2014-02-16 13:19:26 +01:00