]> git.pond.sub.org Git - empserver/blobdiff - src/lib/subs/bridgefall.c
bridgefall: Fix loss of bridge support with EASY_BRIDGES off
[empserver] / src / lib / subs / bridgefall.c
index 52fab404f0b780d9a0a2c702090f76b74d8663b2..ffc79f98d1ed78e191834601cfa8fba2ecec3142 100644 (file)
@@ -66,7 +66,7 @@ bridge_damaged(struct sctstr *sp)
     des = sp->sct_type;
     if (des == SCT_BSPAN || des == SCT_BTOWER)
        knockdown(sp);
-    if ((des == SCT_BHEAD || des == SCT_BTOWER) && !opt_EASY_BRIDGES)
+    if ((des == SCT_BHEAD && !opt_EASY_BRIDGES) || des == SCT_BTOWER)
        bridgefall(sp);
 }
 
@@ -82,9 +82,6 @@ bridgefall(struct sctstr *sp)
     int nnx;
     int nny;
 
-    if (CANT_HAPPEN(opt_EASY_BRIDGES))
-       return;
-
     for (i = 1; i <= 6; i++) {
        nx = sp->sct_x + diroff[i][0];
        ny = sp->sct_y + diroff[i][1];
@@ -97,6 +94,15 @@ bridgefall(struct sctstr *sp)
            nnx = nx + diroff[j][0];
            nny = ny + diroff[j][1];
            getsect(nnx, nny, &bh_sect);
+           /* With EASY_BRIDGES, it just has to be next to any
+              land */
+           if (opt_EASY_BRIDGES) {
+               if (bh_sect.sct_type != SCT_WATER &&
+                   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;