Commit graph

425 commits

Author SHA1 Message Date
7e2008e7f4 License upgrade to GPL version 3 or later
Why upgrade?  I'm not a lawyer, but here's my take on the differences
to version 2:

* Software patents: better protection against abuse of patents to
  prevent users from exercising the rights under the GPL.  I doubt
  we'll get hit with a patent suit, but it's a good move just on
  general principles.

* License compatibility: compatible with more free licenses, i.e. can
  "steal" more free software for use in Empire.  I don't expect to steal
  much, but it's nice to have the option.

* Definition of "source code": modernization of some details for today's
  networked world, to make it easier to distribute the software.  Not
  really relevant to us now, as we normally distribute full source code.

* Tivoization: this is about putting GPL-licensed software in hardware,
  then make the hardware refuse to run modified software.  "Neat" trick
  to effectively deny its users their rights under the GPL.  Abuse was
  "pioneered" by TiVo (popular digital video recorders).  GPLv3 forbids
  it.  Unlikely to become a problem for us.

* Internationalization: more careful wording, to harden the license
  outside the US.  The lawyers tell us it better be done that way.

* License violations: friendlier way to deal with license violations.
  This has come out of past experience enforcing the GPL.

* Additional permissions: Probably not relevant to us.

Also include myself in the list of principal authors.
2011-04-12 21:20:58 +02:00
439f111f98 Remove option SLOW_WAR
SLOW_WAR has issues:

* The check whether the attacker old-owns the attacked sector is
  broken, because att_abort() uses sect.sct_oldown uninitialized.

  Spotted by the Clang Static Analyzer.

* Its implementation in setrel() is somewhat scary.  It's actually
  okay, because that part of setrel() only runs within decl().  Other
  callers don't reach it: update_main() because player->god != 0
  there, and the rest because they never pass a rel < HOSTILE.

* Documentation is a bit vague.

SLOW_WAR hasn't been used in a public game in years.  Fixing it is not
worth it, so remove it instead.
2011-02-13 15:59:49 +01:00
c4024ee815 Update change log for 4.3.26 2010-05-24 18:38:35 +02:00
4613c6d8f2 Update info version example to current output 2010-05-24 18:23:32 +02:00
f6cab16b65 Don't capitalize words in the middle of sentences
Affects output of commands add, anti, build, edit, order, reset, set,
setresource, setsector, show, version.
2010-05-24 18:23:32 +02:00
ea4662061d Fix info Damage on bars, people and planes
It assumed option SUPER_BARS enabled.  It's disabled by default since
4.0.9.

It assumed people_damage = 0.4.  It's 1.0 since 4.0.0.

It still claimed damaging a sector doesn't damage its planes.  It does
since 4.0.9.
2010-05-09 09:08:04 +02:00
e99ba304a5 Fix info Innards on workforce
Has always been wrong.
2010-04-02 19:39:37 +02:00
0e2d533e39 Update change log again for 4.3.25 2010-03-21 09:28:23 +01:00
83c4d37ade Update change log again for 4.3.25 2010-03-20 18:54:10 +01:00
fea24d10da Update change log for 4.3.25 2010-03-16 21:42:10 +01:00
52acb4fb3c Update change log again for 4.3.24 2010-01-26 22:30:24 +01:00
0e3bf4c38a Update change log for 4.3.24 2010-01-19 08:40:43 +01:00
73e25ff21e Update copyright notice 2010-01-19 08:40:17 +01:00
0ba61f1714 Record news more compactly
Member nws_uid is unused since the commit before previous.  Remove it.

Member nws_seqno is of marginal value, because we write news only
through ncache[], and thus aren't prone to the errors sequence numbers
can catch.  Remove it.

Make timestamp selector virtual, computing nws_when + nws_duration,
and remove member nws_timestamp.  Impact:

* In ncache(), the removed timestamp equals nws_when + nws_duration,
  both for new news and updated news.  No change.

* delete_old_news() becomes invisible.  Before, its move of unexpired
  news to the beginning of the news file touched all the timestamps.
  That was unwanted, because the move does not change news, only their
  storage.  Improvement.

* empdump no longer flags the imported news changed via the timestamp.
  This is somewhat unfortunate.  Document as bug.

With these members removed, struct nwsstr no longer matches struct
emptypedstr, so clear news table flag EFF_TYPED and remove union
empobj_storage member news.  This loses the automatic maintenance of
member ef_type via struct emptypedstr.  Remove ef_type as well.

This shrinks struct nwsstr from 20 to 12 bytes on common 32 bit
machines, and from 32 to 16 bytes on common 64 bit machines.  Since
the server doesn't map the whole news file (EFF_MAP is off), this
reduces I/O, while the table's memory use remains the same.

Historical note: struct nwsstr is now pretty much what it was back in
BSD Empire 1.1.  Members ef_type and nws_uid go back to Empire 3 (for
C_SYNC?).  v4.3.12 added member nws_timestamp, which doubled the size
on common 64 bit machines.  v4.3.15 added nws_seqno.
2010-01-19 08:21:56 +01:00
5eb1250ff2 Update change log for 4.3.23 2009-12-13 17:37:13 +01:00
c5e2c99546 Fix info navigate on missile interdiction targets
Missile interdiction targets only "valuable" ships since Empire 3.
2009-12-13 08:20:01 +01:00
a4b167eb18 Fix info Mobility not to claim missions get a bonus
Bonus was dropped in v4.0.0.
2009-12-13 08:19:54 +01:00
6ee75ce4e9 Fix typo in info Selector 2009-12-13 08:03:49 +01:00
a269cdd7e9 Limit nukes to strategic missions
Before Empire 2, nukes could be delivered only with bomb (special
mission 'n', airburst only) and launch (targeting sectors or
satellites only).

Empire 2 made nukes available for any kind of bombing, and for any
missile strike on sectors or ships.  This included interdiction and
support missions.  Nuclear-tipped anti-sats and bomb mission n were
removed.

Unfortunately, this was done in a messy way, which led to
inconsistencies and bugs.  The problem is that ordinary damage affects
just the target, while nuke damage affects an area.  Code dealing with
plane damage was designed for the former.  Instead of rewriting it to
cope with area damage cleanly, nuke damage got shoehorned into
pln_damage(), the function to compute conventional plane damage, as a
side effect: computing damage blasted sectors in the area.

If the plane carried a nuke, pln_damage() returned zero (conventional)
damage.  Without further logic, this simply bypassed the code to apply
damage to the target.  This worked out okay when the target already
got damaged correctly by the side effect.

However, some targets are immune to the side effect: when interdicting
a move or explore command, the commodities being moved are not in any
sector.

For other targets, damage has effects other than damaging the target:
offensive and defensive support don't apply the (conventional) damage
to the target sector.  Instead, they turn it into a combat bonus.
Without further logic, nuclear damage doesn't contribute to that.

To make all that work, pln_damage() returned the nuclear damage for
ground zero as well.  Because a plane does either conventional or
nuclear damage, one of them is always zero.

Most callers simply ignored the nuclear damage, and applied only the
conventional damage.

Bug: land units and ships failed to retreat when pin-bombed or
missiled with a nuke.  That's because they received zero conventional
damage.

The mission code flies planes and missiles and tallies their damage.
This mission damage included nuclear damage at ground zero (except for
missiles sometimes, see below), to make support and commodity
interdiction work.  Unfortunately, this broke other things.

Bug: when bombers interdicted ships or land units, nukes first damaged
the ships or land units by the side effect, then again through mission
damage.  Interdicting missiles had a special case to avoid this.

Bug: when interdicting move, explore or transport, nukes first damaged
the sector by the side effect, then again through mission damage's
collateral damage.

There may well be more bugs hiding in this mess.

The mess is not worth fixing.  While the idea of interdicting and
supporting with nukes sounds kind of cool, I believe it's pretty
irrelevant in actual play.

Instead, go back to a variation of the original rules: nukes can be
delivered only through bomb mission 's' and launch at sectors.

Make arm reject marine missiles in addition to satellites, ABMs and
SAMs, and clear the mission.  Make mission reject planes armed with
nukes.  Oops when they show up in mission_pln_equip() anyway.

Make pln_equip() allow planes with nukes only for missions 's' and
't'.

Clean up pln_damage() to just compute damage, without side effect.
Change strat_bomb() and launch_missile() to detonate nukes.  Simplify
the other callers.  Parameter mission of msl_launch_mindam() is now
unused, remove it.

Missiles exploding on launch no longer set off their nukes.  That was
pretty ridiculous anyway.
2009-12-13 07:46:00 +01:00
cf960a573c Make anti-sat launch consistent with interception
When a manually launched anti-sat hits, it now always destroys the
satellite.  This matches what it does when it intercepts
automatically.  Before, it only damaged the satellite.
2009-12-12 16:28:52 +01:00
5f5362cece Make sweep require capability sweep
Before, sweep accepted any plane.  Planes without capability sweep
flew an ordinary recon mission.

Partial fix for #1388263.
2009-12-08 08:15:51 +01:00
3cea4ac5be Make drop require capability cargo
Before, drop worked like fly: it accepted any plane, but planes
without capability cargo dropped nothing.

Partial fix for #1388263.
2009-12-08 08:15:51 +01:00
1c5bfa0eab Clarify flying command info pages on plane selection 2009-12-08 08:15:51 +01:00
1ee0287595 Change launch of anti-sat to take plane# argument
Before, it took a sector argument, and targeted the lowest-numbered
satellite there.  Rather inconvenient when your own satellite masks
one of the enemy's.

Moreover, the command could be abused to find all sectors with
satellites.  Now it can "only" be abused to find satellite ids, and
whether they're in range.  Still not ideal, but tolerable.
2009-12-08 08:15:50 +01:00
2b31f644db Enable marine msl. unconditionally, remove option PINPOINTMISSILE
Deities can still control them by customizing table plane-chr.
2009-12-08 08:15:50 +01:00
ac33576a99 Update info version example to current output 2009-12-08 08:15:50 +01:00
c0b2eec69d Fix workforce formula in info Innards 2009-12-05 15:19:37 +01:00
5705ab91b8 Slight info markup normalization
Consistently use \*(f, not \f, and \e, not \\.
2009-12-05 15:19:37 +01:00
2b237bfa89 Info markup fixes 2009-12-05 15:19:37 +01:00
1d1e789782 Make budget's "Sector building" line look better
Number of sectors were not aligned with the other lines.  While there,
print properly plurized "sector" instead of "sct(s)".
2009-07-19 13:58:47 -04:00
44c36fa7d5 Make sector maintenance cost configurable
Replace the fixed $1 per ETU maintenance for capital/city sectors that
are at least 60% efficient by a configurable maintenance cost, payable
regardless of efficiency.  The only change in the default
configuration is that inefficient capitals now pay maintenance.
Charging sector maintenance regardless of efficiency is consistent
with unit maintenance.

New struct dchrstr member d_maint and sector-chr selector maint.  Make
show_sect_build() show it.  Change produce_sect() to record
maintenance in new slot p_sect[SCT_MAINT] instead of abusing
p_sect[SCT_CAPIT].  Replace the "Capital maintenance" line in budget
by "Sector maintenance".
2009-07-19 13:58:47 -04:00
48ff09664b Overhaul show sect b
Print sector type mnemonic and name, like show sect s and c.  Print
"can't" instead of negative number for sectors players can't designate
(this was not an issue before the previous commit).  Show build cost
per 100%, like show ship, land, plane and nuke.  Size the columns more
sensibly.
2009-07-19 13:58:40 -04:00
e250301140 Update change log for 4.3.22 2009-04-25 13:57:45 +02:00
ff28200d91 Fix info build, mine, navigate, sweep on mines 2009-03-31 23:03:41 +02:00
d1b39676e2 Change mine command not to work under bridges for now
This is for consistency with aerial mining.  Seamines don't work under
bridges anyway (they did a long time ago, until Empire 2).

Making seamines work under bridges again wouldn't be hard, but it
would make the 'X' in bmaps ambiguous.
2009-03-31 23:03:41 +02:00
5dcd748f9d Don't advertize ^D as means to end a telegram
getele() aborts the telegram on EOF since commit bc8a4432 (v4.2.21).
Besides, ^D may not work with some clients.
2009-03-22 09:52:06 +01:00
009fc1403c Update change log again for 4.3.21 2009-03-09 22:35:18 +01:00
8df262bada Update change log again for 4.3.21 2009-03-09 21:33:30 +01:00
84008cf870 Update change log again for 4.3.21 2009-03-08 18:24:32 +01:00
fa03ba9aad Update change log for 4.3.21 2009-03-08 14:44:29 +01:00
d87a9eb61b Update change log again for 4.3.20 2009-02-20 19:15:01 +01:00
6d6301afe8 Update change log for 4.3.20 2009-02-17 20:14:32 +01:00
2c0e7df5ea Fix a few inaccuracies in info supply 2009-02-17 19:32:14 +01:00
ed5ca70cb2 Disable recursive supply of land units
Its implementation in s_commod() increases lnd_seqno even when
!actually_doit, which can cause spurious seqno oopses in callers of
lnd_could_be_supplied().  I can't be bothered to clean up this mess
right now, because recursive resupply is too dumb to be really useful
anyway: each step uses the first source it finds, without
consideration of mobility cost.
2009-02-17 19:30:35 +01:00
d58b306780 Don't suggest only supply ships can tend in info tend and ltend 2009-02-17 19:30:35 +01:00
c42c96f976 Don't lie about shell supply in info fire
It claimed ships and land units don't need shells if they can draw
them from a supply source.  That was never true for ships, I believe,
and became wrong for land units in commit f6c87d21.
2009-02-17 19:30:35 +01:00
9dd9679377 Clean up info lmine a bit 2009-02-17 19:30:34 +01:00
7da69c92e0 Don't use automatic supply to avoid starvation at the update
Food supply during update adds complexity to the update.  How much
good it does to players is highly doubtful; certainly nobody can rely
on it.  It isn't covered by the starvation command.  Starving ships or
land units can steal enough food from their sector to make it starve,
too.  Finally, the supply code is notoriously hard to use correctly.
We don't know of issues with the update's use, but we haven't
convinced ourselves that there aren't any either.
2009-02-15 12:51:05 +01:00
c0b300d875 Sectors and ships no longer need shells to fire flak
4.0.9 changed flak not to use up shells, but they still had to be
present.  Drop that, because it doesn't really provide any value.
Moreover, this gets rid of the buggy flak shell supply code (seqno
mismatch oopses, lost supplies).
2009-02-14 14:17:44 +01:00
00b5cb2b8a Update info Interception for air defense integration
Was missed in commit 6564ff22.  While there, delete details on fuel
use that became wrong in Empire 3.
2009-02-11 20:10:01 +01:00