extern struct dchrstr bigcity_dchr;
#define IS_BIG_CITY(type) (dchr[(type)].d_pkg == UPKG)
+#define IS_BRIDGE_HEAD(type) \
+ ((type) == SCT_BHEAD || (type) == SCT_HIWAY || (type) == SCT_BTOWER)
+
/* Minimal efficiency of sectors that can be knocked down (bridges) */
#define SCT_MINEFF 20
char buf[1024];
if (opt_EASY_BRIDGES == 0) { /* must have a bridge head or tower */
- if (sp->sct_type != SCT_BTOWER) {
- if (sp->sct_type != SCT_BHEAD)
- return 0;
- if (sp->sct_newtype != SCT_BHEAD)
- return 0;
- }
+ if (!IS_BRIDGE_HEAD(sp->sct_type))
+ return 0;
+ if (sp->sct_newtype != sp->sct_type)
+ return 0;
}
if (sp->sct_effic < 60 && !player->god) {
continue;
if (sect.sct_type == SCT_SANCT)
breaksanct++;
- if ((des == SCT_HARBR || des == SCT_BHEAD) && !sect.sct_coastal) {
+ if (des == SCT_HARBR && !sect.sct_coastal) {
pr("%s does not border on water.\n",
xyas(nstr.x, nstr.y, player->cnum));
if (player->god)
if (sect.sct_x == cap_x && sect.sct_y == cap_y
&& des != SCT_CAPIT && des != SCT_SANCT && des != SCT_MOUNT)
pr("You have redesignated your capital!\n");
- if (opt_EASY_BRIDGES == 0) { /* may cause a bridge fall */
- if (n != SCT_BHEAD)
- continue;
+ if (!opt_EASY_BRIDGES && IS_BRIDGE_HEAD(n))
bridgefall(§);
- }
}
if (changed)
writemap(player->cnum);
des = sp->sct_type;
if (des == SCT_BSPAN || des == SCT_BTOWER)
knockdown(sp);
- if ((des == SCT_BHEAD || des == SCT_BTOWER) && !opt_EASY_BRIDGES)
+ if (IS_BRIDGE_HEAD(des) && !opt_EASY_BRIDGES)
bridgefall(sp);
}
if (nnx == sp->sct_x && nny == sp->sct_y)
continue;
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) {
if (bh_sect.sct_type != SCT_WATER &&
bh_sect.sct_type != SCT_BSPAN)
break;
+ } else {
+ if (IS_BRIDGE_HEAD(bh_sect.sct_type)
+ && bh_sect.sct_newtype == bh_sect.sct_type)
+ break;
}
}
if (j > 6) {