X-Git-Url: http://git.pond.sub.org/?p=empserver;a=blobdiff_plain;f=src%2Flib%2Fsubs%2Fbridgefall.c;h=160bd3167bc10b7fd4a4cfe3fb2ff5c83faebb79;hp=c11529d1e4424064e393876ae57c27c60146b2b4;hb=40eb78eb74474597b79d05c4a5934ff02fb9e127;hpb=13cca55a9da7f9f7fc99b9c40b372f6ef79e6edb diff --git a/src/lib/subs/bridgefall.c b/src/lib/subs/bridgefall.c index c11529d1e..160bd3167 100644 --- a/src/lib/subs/bridgefall.c +++ b/src/lib/subs/bridgefall.c @@ -48,6 +48,31 @@ #include "sect.h" #include "xy.h" +static void knockdown(struct sctstr *, struct emp_qelem *); + +/* + * Check bridges at and around SP after damage to SP. + * If SP is an inefficent bridge, splash it. + * If SP can't support a bridge, splash unsupported adjacent bridges. + * Don't drown planes in LIST when splashing bridges. + * Write back splashed bridges, except for SP; writing that one is + * left to the caller. + */ +void +bridge_damaged(struct sctstr *sp, struct emp_qelem *list) +{ + int des; + + if (sp->sct_effic >= SCT_MINEFF) + return; + + des = sp->sct_type; + if (des == SCT_BSPAN || des == SCT_BTOWER) + knockdown(sp, list); + if ((des == SCT_BHEAD || des == SCT_BTOWER) && !opt_EASY_BRIDGES) + bridgefall(sp, list); +} + void bridgefall(struct sctstr *sp, struct emp_qelem *list) { @@ -94,7 +119,7 @@ bridgefall(struct sctstr *sp, struct emp_qelem *list) /* Knock down a bridge span. Note that this does NOT write the * sector out to the database, it's up to the caller to do that. */ -void +static void knockdown(struct sctstr *sp, struct emp_qelem *list) { struct lndstr land;