]> git.pond.sub.org Git - empserver/log
empserver
15 years agoFix relation checks in load, unload, lload, lunload
Markus Armbruster [Sun, 4 Jan 2009 09:49:17 +0000 (10:49 +0100)]
Fix relation checks in load, unload, lload, lunload

The check for ship owner's relations to the player was backward: it
checked the player's relations to the ship's owner instead.  Abusable:
you could load and unload any ship by declaring friendly to its owner.
Broken since Chainsaw let you load and unload friendly ships.

The check for land unit owner's relations to the player was similarly
backward, similarly abusable, and also broken since day one.

lload and lunload checked sector owner's relations to the land unit's
owner instead of to the player.  Harmless, because the two must be the
same to reach the check.

15 years agoDon't warn deities about capital redesignation
Markus Armbruster [Fri, 2 Jan 2009 08:09:09 +0000 (09:09 +0100)]
Don't warn deities about capital redesignation

15 years agoChange info not to prepend a header line to the info page
Markus Armbruster [Sun, 28 Dec 2008 18:54:16 +0000 (19:54 +0100)]
Change info not to prepend a header line to the info page

The contents of the line was partly useless (repetition of the command
argument) and partly misleading (modification time of the formatted
info file, ifndef _WIN32).

15 years agoFix line break accident
Markus Armbruster [Sun, 28 Dec 2008 16:59:26 +0000 (17:59 +0100)]
Fix line break accident

15 years agoMake the "You lost your capital" message point to info capital
Markus Armbruster [Sun, 28 Dec 2008 16:49:21 +0000 (17:49 +0100)]
Make the "You lost your capital" message point to info capital

New players appear to be unable to figure out how to set a new
capital, in particular a mountain capital.  Hope this helps.

15 years agoMake sure land units with maximum mobility can attack mountains
Markus Armbruster [Sun, 28 Dec 2008 16:28:28 +0000 (17:28 +0100)]
Make sure land units with maximum mobility can attack mountains

Before, land units could not attack a high-mobility terrain sector at
all when the mobility cost to enter it exceeded maximum mobilty.

15 years agoFix land unit attack mobility cost
Markus Armbruster [Sun, 28 Dec 2008 13:01:15 +0000 (14:01 +0100)]
Fix land unit attack mobility cost

Land units were erroneously charged the much lower raw path cost,
except when attacking high-mobility terrain (mountains).  Broken in
commit 2673a258, v4.3.6.

15 years agoFold nstr_resolve_sel() into only remaining caller
Markus Armbruster [Sun, 28 Dec 2008 17:26:42 +0000 (18:26 +0100)]
Fold nstr_resolve_sel() into only remaining caller

No functional change.

15 years agoSmarter identifier resolution in conditions involving strings
Markus Armbruster [Sat, 27 Dec 2008 14:29:54 +0000 (15:29 +0100)]
Smarter identifier resolution in conditions involving strings

Conditions comparing strings behaved rather erratically: while wing=m
was smartly interpreted as wing='m' (because m is ambiguous as plane
selector), wing=e was not so smartly interpreted as wing=effic
(because e unambiguously identifies effic; this was then rejected due
to incompatible types), and wing=g was even less smartly interpreted
as wing=group.

Address this by a redesign of the identifier resolution rules in
nstr_comp(): If the condition contains just one identifier, it names a
selector.  If it contains two, try to intepret either as selector or,
if the other can be interpreted as selector, as value for that.
String selectors accept any identifier as value, numeric selectors
only the ones listed in their table.

Interpret both identifiers as selectors only if their types are
compatible (makes rpath=gu work for ships) and their tables, if any,
match (makes type=spy work for land units).

If more than one interpretation makes sense, drop any value
interpretations of identifiers that are unabbreviated selector names,
and selector interpretations of those that are not (makes wing=w work
for planes).

Change nstr_match_val() to accept any identifier as value for a string
selector.  Replace nstr_mkselval() by nstr_resolve_val(), to resolve
string values in addition to symbolic ones.  Remove resolution to
string from nstr_resolve_id(), drop its last parameter.  Remove unused
nstr_string_ok().  New nstr_is_name_of_ca(), nstr_ca_comparable().

Examples for conditions that are now interpreted differently:

    condition    old interpretation  new interpretation
    wing=g       wing=group          wing='g'
    w=g          wing=group          rejected as ambiguous (1)
    w=e          wing=effic (2)      wing='e'

(1) because both wing='g' and 'w'=group make sense
(2) rejected as incomparable later on

15 years agoSimplify type coercion in condition evaluation
Markus Armbruster [Sat, 27 Dec 2008 15:59:53 +0000 (16:59 +0100)]
Simplify type coercion in condition evaluation

Change nstr_mkselval() to generate values with promoted types only,
and replace nstr_coerce_val() by new and simpler nstr_optype() in
nstr_comp().

Replace the only remaining use of nstr_coerce_val() in surv() by
nstr_promote(), and remove nstr_coerce_val().

This loses one half of the unimplemented sketch of coercions to
NSC_STRING.  Drop the other half from nstr_exec_val().

15 years agoFix reporting of shot spies in news
Markus Armbruster [Thu, 25 Dec 2008 12:55:33 +0000 (13:55 +0100)]
Fix reporting of shot spies in news

Broken in commit 89e33f62, v4.3.16.

15 years agoLand units with zero reaction radius can't go on reserve mission
Markus Armbruster [Sun, 14 Dec 2008 21:49:18 +0000 (16:49 -0500)]
Land units with zero reaction radius can't go on reserve mission

15 years agoRemove econfig key mission_mob_cost
Markus Armbruster [Sun, 14 Dec 2008 21:04:47 +0000 (16:04 -0500)]
Remove econfig key mission_mob_cost

Questionable feature, and hasn't been used in a long time.

15 years agoRemove oprange()'s mission parameter
Markus Armbruster [Sun, 14 Dec 2008 19:05:40 +0000 (14:05 -0500)]
Remove oprange()'s mission parameter

Use the current mission instead.  Make mission() set it before calling
oprange(), and clean up somewhat.

15 years agoCheck capabilities required for mission before range
Markus Armbruster [Sun, 14 Dec 2008 18:40:32 +0000 (13:40 -0500)]
Check capabilities required for mission before range

Checking range first could complain about range when the mission
couldn't work regardless of range.  Not helpful.

15 years agoDrop checks whether we can get the op-sector from mission()
Markus Armbruster [Sun, 14 Dec 2008 18:20:49 +0000 (13:20 -0500)]
Drop checks whether we can get the op-sector from mission()

getsect() can fail here only when the coordinates are invalid.  The
first check uses coordinates from a successful sarg_xy(), so they
can't be invalid.  The second check uses coordinates of an object to
be put on the mission.  If these are invalid, game state is corrupt,
and failing the mission command doesn't improve the situation a bit.

15 years agoSimplify mission() by separating off clear_mission()
Markus Armbruster [Sat, 22 Nov 2008 20:15:03 +0000 (15:15 -0500)]
Simplify mission() by separating off clear_mission()

15 years agoStreamline signature of show_mission()
Markus Armbruster [Sat, 22 Nov 2008 20:04:15 +0000 (15:04 -0500)]
Streamline signature of show_mission()

Remove unused parameter, and return status.

15 years agoMove show_mission() to sole caller, give it internal linkage
Markus Armbruster [Sat, 22 Nov 2008 20:02:18 +0000 (15:02 -0500)]
Move show_mission() to sole caller, give it internal linkage

15 years agoAll missions now have op areas, simplify mission()
Markus Armbruster [Sat, 22 Nov 2008 20:19:27 +0000 (15:19 -0500)]
All missions now have op areas, simplify mission()

15 years agoMake escort mission obey op-area
Markus Armbruster [Sat, 22 Nov 2008 19:52:20 +0000 (14:52 -0500)]
Make escort mission obey op-area

Before, the escort mission didn't support an op-area, and planes on
escort mission escorted anywhere.  Change mission() to define the
op-area for escort missions as well.  Show it in mission() and
show_mission().  Check it in find_escorts().

15 years agoRemove non-mission land unit reaction
Markus Armbruster [Tue, 25 Nov 2008 01:31:22 +0000 (20:31 -0500)]
Remove non-mission land unit reaction

Land unit reactions are overly complex because we have two different
concepts controlling them: reaction radius (set with lrange) and
reserve mission (set with mission).  You need to deal with both to set
up or query reactions.

Commit 8d0e1af5 "fixed" this by making reserve missions meaningless.

The previous commit made reserve missions meaningful again: they
support an op-area now.  This brought back the problem of having to
deal with two separate commands to accomplish one thing.

Fix this for good by removing non-mission land unit reaction
alltogether.  The only feature we lose by that is the ability to order
land units to react until the order is explicitely cancelled.  That's
because missions are implicitely cleared by many commands and events,
while non-mission reaction wasn't.  Closes #858121 and #858122.

Remove the non-mission reaction case from att_reacting_units().

Don't limit reserve missions to the land unit's reaction radius: make
lnd_reaction_range() return the type's maximum radius instead of
lnd_rad_max.

The reaction radius is now useless.  Remove the lrange command, and
struct lndstr member lnd_rad_max along with its selector react.
Remove land command's column rd.  Make ldump show column react as
zero.  Deprecate edit key 'P' in dounit(), and don't show it in
pr_land().

15 years agoMake land units on reserve mission react within op-area
Markus Armbruster [Sat, 22 Nov 2008 19:40:37 +0000 (14:40 -0500)]
Make land units on reserve mission react within op-area

Before, they always reacted to their maximum range, and the op-area
was unused.  Change mission() to define the op-area for reserve
missions as well.  Remove the special-case for showing reserve
missions from mission() and show_mission().  New lnd_reaction_range()
factored out of att_reacting_units().  Use it in oprange() to cover
reserve missions.  Pass the mission as separate parameter to oprange()
for now, because miss() doesn't set it in the object until later.

15 years agoNew in_oparea(), factored out of build_mission_list_type()
Markus Armbruster [Sat, 22 Nov 2008 17:06:54 +0000 (12:06 -0500)]
New in_oparea(), factored out of build_mission_list_type()

15 years agoDon't reduce mission op area when range shrinks
Markus Armbruster [Fri, 21 Nov 2008 13:05:24 +0000 (08:05 -0500)]
Don't reduce mission op area when range shrinks

The mission command limits op area radius to the possible range.
That's okay, as it doesn't actually restrict possible op areas.  When
the mission is executed, it was limited again.  Don't do that; remove
the limiting code from build_mission_list_type() and show_mission().

The removed limiting had no effect, except when the range shrunk.
Then limiting reduced the op area more than necessary.  For instance,
consider an object O with initial range 3 on a mission around M with
range 3:

    - - - y - - -
     - - z y - -
    - - z x y - -
     - O x x M -
    - - z x y - -
     - - z y - -
    - - - y - - -

Initially, all sectors not marked - are in range and in the op area.
If the range drops to two, sectors marked O, x and z are still in
range of O.  But only the x are still in range of M.  The O and z got
excluded.

Range can currently shrink when plane range is reduced (range
command), or a ship, plane or land unit somehow loses tech (deity
intervention).

15 years agoRemove reserve mission's reaction radius bonus
Markus Armbruster [Mon, 17 Nov 2008 00:57:45 +0000 (19:57 -0500)]
Remove reserve mission's reaction radius bonus

Reserve missions are now useless.  They'll become useful again in a
later commit.

15 years agoUse #if 0 to disable code, not comments
Markus Armbruster [Mon, 17 Nov 2008 02:19:37 +0000 (21:19 -0500)]
Use #if 0 to disable code, not comments

15 years agoClean up removal of reserve mission mobility bonus
Markus Armbruster [Mon, 17 Nov 2008 02:18:17 +0000 (21:18 -0500)]
Clean up removal of reserve mission mobility bonus

Land units on reserve missions used to pay only half the usual
mobility for combat.  This bonus was commented out in the code in
4.0.0, but not in info.  Remove it from both.

15 years agoRemove commented out logerror() calls
Markus Armbruster [Mon, 17 Nov 2008 02:13:36 +0000 (21:13 -0500)]
Remove commented out logerror() calls

Probably ancient debug cruft.

15 years agoBump version to 4.3.20
Markus Armbruster [Sun, 14 Dec 2008 15:44:02 +0000 (10:44 -0500)]
Bump version to 4.3.20

15 years agoUpdate change log again for 4.3.19 v4.3.19
Markus Armbruster [Sun, 7 Dec 2008 23:15:19 +0000 (18:15 -0500)]
Update change log again for 4.3.19

15 years agoFix make dist in a separate build directory without git
Markus Armbruster [Sun, 7 Dec 2008 23:13:38 +0000 (18:13 -0500)]
Fix make dist in a separate build directory without git

In that case, make copied the sources.mk from $srcdir, but unless it
existed already, the peculiar workings of VPATH did us in: make
searched for the target, found it in $srcdir, and the dependency
became circular.

Fix by keeping sources.mk in $srcdir always.  We can build it there,
because its contents depends only on git state, not on anything in the
build tree.  This avoids the need to copy sources.mk alltogether.

15 years agoLWP doesn't work with Darwin due to OS bugs, avoid it for now
Markus Armbruster [Sun, 7 Dec 2008 22:25:35 +0000 (17:25 -0500)]
LWP doesn't work with Darwin due to OS bugs, avoid it for now

Darwin's getcontext() overruns its argument buffer.

15 years agoDon't let ships double-retreat first on 'i' and then on 'h'
Markus Armbruster [Sun, 7 Dec 2008 14:23:30 +0000 (09:23 -0500)]
Don't let ships double-retreat first on 'i' and then on 'h'

When a ship is shelled, retreat condition 'i' (injured) applies.  When
there's no return fire, 'h' (helpless) applies as well.  Ships
retreated twice in that case.  Fix that.

15 years agoUpdate change log for 4.3.19
Markus Armbruster [Sun, 7 Dec 2008 01:12:18 +0000 (20:12 -0500)]
Update change log for 4.3.19

15 years agoReplace other occurences of git-FOO by git FOO
Markus Armbruster [Wed, 3 Dec 2008 12:57:14 +0000 (07:57 -0500)]
Replace other occurences of git-FOO by git FOO

15 years agoUse 'git ls-files' instead of deprecated 'git-ls-files'
Gerd Flaig [Sat, 29 Nov 2008 21:30:11 +0000 (22:30 +0100)]
Use 'git ls-files' instead of deprecated 'git-ls-files'

15 years agoFix shp_prewrite() to print the sunk message
Markus Armbruster [Tue, 25 Nov 2008 00:08:16 +0000 (19:08 -0500)]
Fix shp_prewrite() to print the sunk message

Broken in commit 861a66625, v4.3.17.

15 years agoLog out player when time per day is exceeded
Ron Koenderink [Sun, 16 Nov 2008 14:42:42 +0000 (08:42 -0600)]
Log out player when time per day is exceeded

Commit 3da4030 already changed player_main() to log out the player
when m_m_p_d was exceeded in command().  This crept in accidentally.
Complete the job by changing status() to log out the player instead of
downgrading him to visitor status.

Also, change player_main(), command() and status() to apply the time
limit to countries in sanctuary in addition to active countries.
Leave visitors alone, because those are shared logins.  Make the
disconnect message to a player consistent for all situations.

Note that commit 875a80d1 already changed player_main() to apply the
time limit only to active countries instead of all, just like status()
does, but neglected to document that.

15 years agoFix nat_timeused calculation on login
Ron Koenderink [Sun, 16 Nov 2008 02:46:52 +0000 (20:46 -0600)]
Fix nat_timeused calculation on login

Broken in commit 875a80d.

15 years agoPrevent command from execute after game restrictions
Ron Koenderink [Sat, 15 Nov 2008 22:50:44 +0000 (16:50 -0600)]
Prevent command from execute after game restrictions

If a player is at a prompt when either game hours
restrictions starts or logged in time limit is exceeded
the player is allow to enter one command.

15 years agoCapital obliteration failed to charge money and report news
Markus Armbruster [Sat, 15 Nov 2008 21:43:13 +0000 (16:43 -0500)]
Capital obliteration failed to charge money and report news

Commit 221e88f1 (v4.3.15) made caploss() expect the new owner in
sct_own, so it can distinguish between sack and obliteration.  Commit
0d139ee1 (v4.3.17) broke that in sct_prewrite(): it moved zapping the
sector owner after caploss(), and passed 0 instead of the old owner to
caploss().  Because of that, obliterating a capital didn't make the
news and didn't cost the victim money.  Fix that.

15 years agoUpdate emptime.c.patch for commit cb0a373
Ron Koenderink [Sat, 15 Nov 2008 22:21:02 +0000 (16:21 -0600)]
Update emptime.c.patch for commit cb0a373

15 years agoDon't call time() for nat_last_login, use player->curup
Markus Armbruster [Sat, 15 Nov 2008 20:58:28 +0000 (15:58 -0500)]
Don't call time() for nat_last_login, use player->curup

15 years agoFix coding style and simplify seconds_since_midnight() a bit
Markus Armbruster [Sat, 15 Nov 2008 20:48:17 +0000 (15:48 -0500)]
Fix coding style and simplify seconds_since_midnight() a bit

15 years agoClean up unused variable in status()
Markus Armbruster [Sat, 15 Nov 2008 20:54:29 +0000 (15:54 -0500)]
Clean up unused variable in status()

Unused since commit 875a80d1.

15 years agoRewrite accounting of play time
Ron Koenderink [Sat, 15 Nov 2008 19:08:19 +0000 (13:08 -0600)]
Rewrite accounting of play time

Replace daychange() and gettimeleft() by update_timeused_login(),
update_timeused() and enforce_minimum_session_time().  The new
code doesn't assume the day is always 24 hours long which can
occur when transitioning into or out of DST and such.  Logging
in after more a multiple of 128 days now resets nat_timeused
properly.

Fix nat_timeused calculation on midnight rollover to include
the time since midnight.

struct natstr member nat_dayno and struct player member timeleft
are now unused, remove them.

15 years agoFix initialization of nat_last_logout
Ron Koenderink [Mon, 10 Nov 2008 00:17:46 +0000 (18:17 -0600)]
Fix initialization of nat_last_logout

Broken in f94f81ee, v4.2.22.

15 years agoFix parsing of 24:00 in game_hours and update_demandtimes
Ron Koenderink [Mon, 10 Nov 2008 00:06:51 +0000 (18:06 -0600)]
Fix parsing of 24:00 in game_hours and update_demandtimes

daytime() rejects 24:00 as invalid.  This makes daytime_range()
fail, is_daytime_allowed() ignore this and later ranges silently.
Broken in commit acdee1e3, v4.2.15.

15 years agoNew option RAILWAYS
Markus Armbruster [Sun, 26 Oct 2008 17:24:41 +0000 (13:24 -0400)]
New option RAILWAYS

With RAILWAYS, highway-like sectors double as rail.  They need to be
at least 5% efficient to be operational, and then they additionally
extend rail into adjacent sectors that are at least 60% efficient.

New opt_RAILWAYS, SCT_HAS_RAIL(), sct_rail_track().  Update
sector_mcost(), bp_neighbors(), lnd_mar_one_sector() for RAILWAYS
mobility rules.  Update sinfra(), spyline(), satdisp_sect() to show
rail track instead of rail infrastructure for RAILWAYS.

New virtual sector selector track, implemented by nsc_sct_track().

15 years agoAge che just like reserves (1% per 24 ETUs)
Markus Armbruster [Sun, 26 Oct 2008 17:08:01 +0000 (13:08 -0400)]
Age che just like reserves (1% per 24 ETUs)

Factor aging out of age_levels() into new age_people().  Use it in
do_feed() to age che.

15 years agoPermit ships to assault the sector they're in
Markus Armbruster [Thu, 24 Apr 2008 18:38:57 +0000 (20:38 +0200)]
Permit ships to assault the sector they're in

Ships still have to be in a sea sector to assault an adjacent sector.

15 years agoDon't produce food without work
Markus Armbruster [Tue, 1 Apr 2008 18:17:52 +0000 (20:17 +0200)]
Don't produce food without work

We don't want to starve tiny populations, because that would require
players to move trivial amounts of food after explore and such.
growfood() used to simply grow at least 1f when a sector was about to
starve.  That food is almost never eaten by a tiny population, so we
effectively got some production without work.  Fix by taking away that
free food after people ate, in do_feed().

15 years agoNew concept sector terrain
Markus Armbruster [Wed, 13 Feb 2008 19:54:08 +0000 (20:54 +0100)]
New concept sector terrain

A sector type's terrain (struct dchrstr member d_terrain) is the
sector type of its underlying terrain.  Sector types occuring in
d_terrain are terrain types, and must have their own type in
d_terrain.  Players can change sector types only to those with the
same terrain.

The builtin configuration defines terrain types sea, mountain,
wasteland, wilderness and plains.  It gives bridge span and tower
terrain sea, and everything else terrain wilderness.  Hence, the stock
game remains unchanged.

Deities can use terrain to create sector types that can be developed
only in limited ways.

15 years agoExplicitly specify dependency output file with gcc -MF
Markus Armbruster [Tue, 28 Oct 2008 23:27:23 +0000 (19:27 -0400)]
Explicitly specify dependency output file with gcc -MF

Used to work without that, but somehow no longer does.

15 years agoRepresent logged in time in seconds rather than minutes
Ron Koenderink [Tue, 28 Oct 2008 14:48:25 +0000 (08:48 -0600)]
Represent logged in time in seconds rather than minutes

This simplifies things.  In particular, it gets rid of random rounding
in getcommand(), which created a variation in the nightly build
depending on whether the update starts before or after the deity logs
out.

Replace struct natstr member nat_minused by nat_timeused, and update
cou_ca[] accordingly (this affects xdump nat).  Replace player member
minleft by timeleft, and getminleft() by gettimeleft().  Update
getcommand(), daychange(), player_main(), status() accordingly, taking
care not to change player output.  Change edit country key 'u' to work
in seconds.

15 years agoCorrect the emptime.c.patch for player.c
Ron Koenderink [Mon, 27 Oct 2008 03:12:10 +0000 (21:12 -0600)]
Correct the emptime.c.patch for player.c

Broken in commit 122171b.

15 years agoAdd a time base for nightly builds
Ron Koenderink [Sun, 26 Oct 2008 21:59:43 +0000 (15:59 -0600)]
Add a time base for nightly builds

Increment the time base at the each update.
Remove the unnecessary patches that overrode
the timestamp printouts.

15 years agoAdd more tests to nightly builds
Ron Koenderink [Sun, 26 Oct 2008 21:56:04 +0000 (15:56 -0600)]
Add more tests to nightly builds

Add Player 02 as an ally for Player 01.
Add tests for telegrams, wall, announce, relationships,
land units, wire, fire, attack, planes, autofish and autooil.

15 years agoBump version to 4.3.19
Markus Armbruster [Sun, 19 Oct 2008 18:41:55 +0000 (14:41 -0400)]
Bump version to 4.3.19

15 years agoUpdate change log for 4.3.18 v4.3.18
Markus Armbruster [Sat, 18 Oct 2008 18:40:27 +0000 (14:40 -0400)]
Update change log for 4.3.18

15 years agoOops when unit_carrier_change() arguments OLD or NEW are invalid
Markus Armbruster [Sat, 18 Oct 2008 18:21:45 +0000 (14:21 -0400)]
Oops when unit_carrier_change() arguments OLD or NEW are invalid

15 years agoAdd scrap and scuttle tests to nightly builds
Ron Koenderink [Fri, 10 Oct 2008 03:49:07 +0000 (21:49 -0600)]
Add scrap and scuttle tests to nightly builds

Also general improvements to economy for player 08.

15 years agoAdd land units tests to nightly builds and improve economy
Ron Koenderink [Wed, 8 Oct 2008 13:52:10 +0000 (07:52 -0600)]
Add land units tests to nightly builds and improve economy

Up the bar production.  Start education and tech for player 08
Improve the general economy for player 08.  Add land units building
tests to player 01, including ensuring the tech is high to build.

15 years agoFix initialization of new elements in plane, land and nuke tables
Ron Koenderink [Mon, 6 Oct 2008 23:58:59 +0000 (17:58 -0600)]
Fix initialization of new elements in plane, land and nuke tables

ef_init_srv() neglected to set struct empfile callback oninit.  This
made unit_carrier_change() crash or oops on freshly initialized
planes, land units and nukes, i.e. when build used an uid that hadn't
been used before.  Oops recovery worked.

Broken in commit 64a53c90, v4.3.17.

15 years agoAdd xdump tests to nightly builds
Ron Koenderink [Sun, 28 Sep 2008 15:03:50 +0000 (09:03 -0600)]
Add xdump tests to nightly builds

Add xdump meta test to Turn 00 Player 02 to verify player visibility.
Add xdump test to Turn 99 Player 00 to verify xdump output.
Add xdump test to Turn 99 Player 01 to player's version of xdump
output.

15 years agoAdd xdump meta and table accessible tests to nightly builds
Ron Koenderink [Sat, 27 Sep 2008 23:41:06 +0000 (17:41 -0600)]
Add xdump meta and table accessible tests to nightly builds

15 years agoMove test scripts from nightlybuild.sh to separate files
Ron Koenderink [Sat, 27 Sep 2008 01:47:16 +0000 (19:47 -0600)]
Move test scripts from nightlybuild.sh to separate files

The test scripts are now in nightly/tests/TURN/PLAYER.  For each turn,
the update script is executed first (except for turn 00), and then all
the player scripts in the appropriate turn directory.  This runs
runfeed() in different directories; change it to accomodate for that.

The update script runs "report *" on all updates.  Before, it ran only
on some of them.

15 years agoAdd missing cd to patch step for nightlybuild.sh
Ron Koenderink [Fri, 26 Sep 2008 23:33:11 +0000 (17:33 -0600)]
Add missing cd to patch step for nightlybuild.sh

If the patch step is ran without the preceeding step, the cwd
is incorrect.

15 years agoCorrection for Ubuntu Conversion
Ron Koenderink [Fri, 26 Sep 2008 03:12:24 +0000 (21:12 -0600)]
Correction for Ubuntu Conversion

Change nightlybuild.sh to allow the setting of the pthread
option for ./configure.  Remove the incorrectly added xml
header line from the ubuntu-pthread.i386.config file.

15 years agoSwitch Linux nightly builds to Ubuntu and add pthread build.
Ron Koenderink [Thu, 25 Sep 2008 02:18:27 +0000 (20:18 -0600)]
Switch Linux nightly builds to Ubuntu and add pthread build.

Remove the cron file for SuSE.  Add cron file for Ubuntu.
Remove LWP config file for SuSE.  Add LWP and pthread config
files for Ubuntu.

15 years agoBump version to 4.3.18
Markus Armbruster [Tue, 23 Sep 2008 01:18:24 +0000 (21:18 -0400)]
Bump version to 4.3.18

15 years agoUpdate change log again for 4.3.17 v4.3.17
Markus Armbruster [Sat, 20 Sep 2008 16:08:41 +0000 (12:08 -0400)]
Update change log again for 4.3.17

15 years agoFix standalone client build for Windows
Markus Armbruster [Sat, 20 Sep 2008 15:57:59 +0000 (11:57 -0400)]
Fix standalone client build for Windows

Need to compile with -mthreads since commit f082ef9f, v4.3.11.

15 years agoDisable incorrect autmatic supply in load and lload
Markus Armbruster [Sat, 20 Sep 2008 13:16:46 +0000 (09:16 -0400)]
Disable incorrect autmatic supply in load and lload

load_land_ship() and load_land_land() automatically resupply the land
units they load.  This can draw supplies from the sector where the
land units are.  When load() and lload() later update the sector, they
wipe out the update made for drawing supplies, and we get a seqno
mismatch oops.  Highly abusable.  Disable for now.

15 years agoUpdate change log for 4.3.17
Markus Armbruster [Thu, 18 Sep 2008 01:31:07 +0000 (21:31 -0400)]
Update change log for 4.3.17

15 years agoUpdate example to current output
Markus Armbruster [Thu, 18 Sep 2008 01:17:52 +0000 (21:17 -0400)]
Update example to current output

15 years agoFix trailing whitespace
Markus Armbruster [Thu, 18 Sep 2008 01:09:14 +0000 (21:09 -0400)]
Fix trailing whitespace

15 years agoFix whitespace: space before tab
Markus Armbruster [Wed, 17 Sep 2008 23:29:42 +0000 (19:29 -0400)]
Fix whitespace: space before tab

15 years agoUpdate known contributors comments
Markus Armbruster [Wed, 17 Sep 2008 22:54:15 +0000 (18:54 -0400)]
Update known contributors comments

15 years agoMake unit_give_away() immune to infinite recursion
Markus Armbruster [Wed, 17 Sep 2008 01:47:55 +0000 (21:47 -0400)]
Make unit_give_away() immune to infinite recursion

Put the unit before recursing into its cargo.  This breaks cycles in
the "is loaded on" relations.  Such cycles exist only in a corrupt
game state.  Mildly inefficient, because callers typically put the
unit again.

15 years agoBelatedly remove DEMANDUPDATE from info Options
Markus Armbruster [Tue, 16 Sep 2008 23:14:41 +0000 (19:14 -0400)]
Belatedly remove DEMANDUPDATE from info Options

Option gone since commit 6ca5e47f, v4.3.10.

15 years agoMake trade show exactly what's on sale, remove option SHOW_PLANE
Markus Armbruster [Tue, 16 Sep 2008 23:11:18 +0000 (19:11 -0400)]
Make trade show exactly what's on sale, remove option SHOW_PLANE

Planes and land units on ships are sold along with the ship, but trade
showed them only when SHOWPLANE was enabled.  Show them always.

Planes on land units are not sold along with the land unit, but trade
showed them when SHOWPLANE was enabled.  Don't.

15 years agoGuard unit.h against multiple inclusion
Markus Armbruster [Tue, 16 Sep 2008 22:47:06 +0000 (18:47 -0400)]
Guard unit.h against multiple inclusion

15 years agoUse unit_wipe_orders() to simplify build.c
Markus Armbruster [Sun, 14 Sep 2008 23:53:14 +0000 (19:53 -0400)]
Use unit_wipe_orders() to simplify build.c

Simplify build_ship(), build_plane(), build_land() and build_nuke().

15 years agoStop ships, planes, land units and nukes on violent takeover
Markus Armbruster [Sun, 14 Sep 2008 23:34:16 +0000 (19:34 -0400)]
Stop ships, planes, land units and nukes on violent takeover

This is for consistency with sectors, and for the same reason: pause
before spending money on stuff taken in the heat of battle.

15 years agoWipe orders when ship, plane, land unit or nuke changes owner
Markus Armbruster [Sun, 14 Sep 2008 23:32:34 +0000 (19:32 -0400)]
Wipe orders when ship, plane, land unit or nuke changes owner

Use new unit_wipe_orders() for violent takeover (takeover_unit() on
behalf of assault, attack, board, lboard, paradrop and pboard), and
peaceful takeover (unit_give_away() on behalf of arm, disarm, load,
unload, lload, lunload, scrap, scuttle, tend, trade).

Before, takeover_unit() cleared only group, mission and ship retreat
orders, and unit_give_away() only group and mission.  Orders that
weren't cleared:

* Mission op area (visible in xdump)

* Ship autonav orders

* Ship sail path including ship to follow and mobility quota

* Plane range limit

* Land unit retreat orders and retreat percentage

15 years agoRefactor and fix takeover.c
Markus Armbruster [Sun, 14 Sep 2008 19:13:16 +0000 (15:13 -0400)]
Refactor and fix takeover.c

Factor new takeover_unit() out of takeover_ship(), takeover_plane(),
takeover_land().  This fixes the following bugs in assault, attack,
board, lboard, paradrop and pboard:

* When the "land unit loaded on land unit" relation had a cycle,
  takeover_land() went into an infinite recursion.  Such cycles exist
  only in a corrupt game state.

* Nukes armed on planes weren't taken over along with their plane.
  Broken in commit 2e40a4bb, v4.3.3.

* Taking over land units with negative mobility increased mobility to
  zero.  Ditto planes embarked on ships or land units.

* Taking over planes embarked on ships or land units didn't clear
  their wing.

* Taking over planes and land units updated their MOB_ACCESS timestamp
  (pln_access, lnd_access), except for planes not embarked on
  anything.  This had no effect.

15 years agoFix marking of unused trade slots
Markus Armbruster [Sun, 14 Sep 2008 16:04:32 +0000 (12:04 -0400)]
Fix marking of unused trade slots

Trade code can't quite decide whether negative trd_unitid or zero
trd_owner marks unused slots.  The former is a bad idea, because blank
slots have a zero trd_unitid.

Make sure to zero trd_owner when setting trd_unitid to negative value
in trad() and check_trade().  This fixes recognition of unused slots
in set (broken in commit e16e38df, v4.2.18) and xdump (never worked).

15 years agoRemove takeover_ship() and takeover_land() parameter hostile
Markus Armbruster [Sun, 14 Sep 2008 15:30:55 +0000 (11:30 -0400)]
Remove takeover_ship() and takeover_land() parameter hostile

All callers pass non-zero.  Simplify accordingly.

15 years agoFix and simplify check_trade()
Markus Armbruster [Sun, 14 Sep 2008 15:12:45 +0000 (11:12 -0400)]
Fix and simplify check_trade()

Use unit_drop_cargo() to drop a sold land unit's cargo.

Use unit_give_away() to transfer ownership.  This fixes the following
bugs and misfeatures:

* Sold nuke wasn't taken off its plane.  Could not happen before
  commit 2e40a4bb, v4.3.3.

* Nuke on a plane wasn't sold along with the plane.  Broken in commit
  2e40a4bb, v4.3.3.

* Planes and land units on sold ships got their mobility zeroed.

* Planes on sold ships didn't get their wing reset.

15 years agoFix cargo giveaway in load, lload, unload, lunload and tend
Markus Armbruster [Sun, 14 Sep 2008 12:03:11 +0000 (08:03 -0400)]
Fix cargo giveaway in load, lload, unload, lunload and tend

Use unit_give_away() in gift().  This fixes a number of bugs:

* Nukes on planes weren't given away along with the plane.

* Likewise for land units on land units (can't happen in the stock
  game).

* Mission was not cleared by unload land/plane, lunload land/plane,
  and lload plane, except for planes on land units.

* Wing and army were never cleared.

It also happens to suppress information on planes given away along
with their land unit carriers.  Shrug.

15 years agoFix cargo giveaway in scrap and scuttle
Markus Armbruster [Sun, 14 Sep 2008 02:06:44 +0000 (22:06 -0400)]
Fix cargo giveaway in scrap and scuttle

When giving away cargo by scrapping or scuttling its carrier, the
cargo's cargo wasn't given away.  Happened for instance when a ship
carrying a land unit carrying a SAM got scrapped.

Also, wing, army and mission weren't cleared.

To fix, create unit_give_away() and use it in unit_drop_cargo().

15 years agoRefactor and fix scuttle and scrap code
Markus Armbruster [Sat, 13 Sep 2008 22:35:50 +0000 (18:35 -0400)]
Refactor and fix scuttle and scrap code

Factor unit_drop_cargo() out of scra(), scuttle_ship(),
scuttle_land(), fix it up:

* Some messages were sent as bulletins instead of printing them.

* Nukes were always destroyed.  They're now treated exactly like other
  cargo.

* scuttle destroyed some cargo silently, and listed other cargo as
  "scuttled".  It now simply lets unit_update_cargo() running from
  carrier prewrite callbacks list all cargo "lost".

Simplify its callers.  scuttle_ship() and scuttle_land() are now
trivial, inline and remove.

15 years agoRequire friendly relations for trade ship to pay off
Markus Armbruster [Sat, 13 Sep 2008 22:05:58 +0000 (18:05 -0400)]
Require friendly relations for trade ship to pay off

15 years agoRefuse to auto-scuttle where it doesn't pay
Markus Armbruster [Sat, 13 Sep 2008 19:57:36 +0000 (15:57 -0400)]
Refuse to auto-scuttle where it doesn't pay

When called from the scuttle command, scuttle_tradeship() asks for
confirmation when scuttling doesn't pay.  When called from the autonav
code, it can't ask.  Change it to fail then, and use that in
nav_ship() to avoid scuttle where it doesn't pay.  Also simplify some.

15 years agoFix when scuttle_tradeship() asks for confirmation
Markus Armbruster [Sat, 13 Sep 2008 21:07:15 +0000 (17:07 -0400)]
Fix when scuttle_tradeship() asks for confirmation

Fix scuttle to ask for confirmation when scuttling a tradeship in an
unsuitable sector even when the tradeship is pirated.  Broken when
commit a99bc3be (v4.2.13) suppressed that for pirated tradeships
wholesale because it let pirates ferret out where the ship was built.

15 years agoFix scuttle_tradeship() to require 2% efficiency
Markus Armbruster [Sat, 13 Sep 2008 20:47:10 +0000 (16:47 -0400)]
Fix scuttle_tradeship() to require 2% efficiency

15 years agoClean up rules on where you can scrap stuff
Markus Armbruster [Sat, 13 Sep 2008 19:27:42 +0000 (15:27 -0400)]
Clean up rules on where you can scrap stuff

You can now scrap ships in own or friendly, efficient harbors, planes
in own or allied, efficient airfields, and land units in any own or
allied sector.

When something can't be scrapped because of these rules, print a
suitable message.

Before, you could scrap ships regardless of relations to sector owner
(info claimed friendly was required), land units regardless of
relations, but not while on ships, and planes even in friendly
airfields (info claimed allied was required).

When scrapping in a deity sector, scrap claimed it gave the cargo to
POGO, which is somewhat bogus, as POGO can't own such stuff.

15 years agoFix scrap and scuttle output when there's output about cargo
Markus Armbruster [Sat, 13 Sep 2008 13:45:26 +0000 (09:45 -0400)]
Fix scrap and scuttle output when there's output about cargo

scra() and scut() printed their "scrapped in" / "scuttled in" message
in two parts.  Messages for scrapped / scuttled cargo were printed
between the parts.  Fix by printing in one go, after the cargo
messages.