]> git.pond.sub.org Git - empserver/commit
Fix ship interdiction targeting ships not at sea
authorMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Jun 2008 09:35:04 +0000 (11:35 +0200)
committerMarkus Armbruster <armbru@pond.sub.org>
Sun, 8 Jun 2008 09:35:04 +0000 (11:35 +0200)
commit3e251b474fb90089c15ea8b5ece4c4f74962d0c0
tree3d111c32e650269905aac963d11f2059bc42cef1
parente1d7f9bf8e3a41ab4a4ab4118773512216e48a84
Fix ship interdiction targeting ships not at sea

perform_mission() needs to know whether it is targeting ships or
something else, because the rules differ: submarines interdict only
ships, land units get their damage reduced when interdicting ships,
and different news are generated.

The old code assumed it was targeting ships when the target sector was
sea.  Wrong when interdicting ships in harbors, bridges and such.
This has always been broken.  Except when checking a submarine's
target: there it tested argument s, which is gross, but at least it
works.  That code was added in v4.0.8.

Replace the broken test by the gross hack everywhere.  This fixes news
and damage from land units when ships get interdicted in non-sea
sectors.
src/lib/subs/mission.c