if (mobtype == MOB_MOVE || mobtype == MOB_MARCH) {
/* linear function in road, base at 0%, base/10 at 100% */
- cost = base * (1.0 - 0.009 * sp->sct_road);
+ cost = base;
+ if (intrchr[INT_ROAD].in_enable)
+ cost -= base * 0.009 * sp->sct_road;
} else if (mobtype == MOB_RAIL) {
- if (sp->sct_rail <= 0)
+ if (!intrchr[INT_RAIL].in_enable || sp->sct_rail <= 0)
return -1.0;
/* linear function in rail, base at 0%, base/100 at 100% */
- cost = base * (1.0 - 0.0099 * sp->sct_rail);
+ cost = base - base * 0.0099 * sp->sct_rail;
} else {
CANT_REACH();
cost = base;
move through it. We calculate it later. */
if (dchr[sp->sct_type].d_mcst == 0)
continue;
- if (bp->bp_mobtype == MOB_RAIL && sp->sct_rail == 0)
+ if (bp->bp_mobtype == MOB_RAIL
+ && (!intrchr[INT_RAIL].in_enable || sp->sct_rail == 0))
continue;
if (sp->sct_own != from->sct_own)
continue;
continue;
}
}
- if (sect.sct_rail == 0 &&
+ if ((!intrchr[INT_RAIL].in_enable || sect.sct_rail == 0) &&
lchr[(int)llp->land.lnd_type].l_flags & L_TRAIN) {
if (together) {
pr("no rail system in %s\n", xyas(newx, newy, actor));