bridgefall: Fix loss of bridge support with EASY_BRIDGES off

With EASY_BRIDGES off, bridge spans need to be next to a bridge tower
or a bridge head that is at least 20% efficient to remain standing.

When a bridge tower or head gets damaged below 20%, adjacent spans may
lose support.  Bug: they don't fall when they're next to another
bridge head below 20%.

Has always been broken.

Signed-off-by: Markus Armbruster <armbru@pond.sub.org>
This commit is contained in:
Markus Armbruster 2014-01-17 20:54:27 +01:00
parent 292bfac797
commit 4824648978
Notes: Markus Armbruster 2015-03-02 08:06:20 +01:00
Closes BUG#36.
4 changed files with 14 additions and 13 deletions

View file

@ -94,11 +94,6 @@ bridgefall(struct sctstr *sp)
nnx = nx + diroff[j][0];
nny = ny + diroff[j][1];
getsect(nnx, nny, &bh_sect);
if (bh_sect.sct_type == SCT_BHEAD &&
bh_sect.sct_newtype == SCT_BHEAD)
break;
if (bh_sect.sct_type == SCT_BTOWER)
break;
/* With EASY_BRIDGES, it just has to be next to any
land */
if (opt_EASY_BRIDGES) {
@ -106,6 +101,13 @@ bridgefall(struct sctstr *sp)
bh_sect.sct_type != SCT_BSPAN)
break;
}
if (bh_sect.sct_effic < 20)
continue;
if (bh_sect.sct_type == SCT_BHEAD &&
bh_sect.sct_newtype == SCT_BHEAD)
break;
if (bh_sect.sct_type == SCT_BTOWER)
break;
}
if (j > 6) {
knockdown(&sect);