(svn r7648) [cbh] - Feature: Allow removal of tracks from bridge heads. However, trains on the bridge must still be able to access the bridge head
--- a/rail_cmd.c Sat Dec 30 12:59:17 2006 +0000
+++ b/rail_cmd.c Sat Dec 30 13:15:15 2006 +0000
@@ -364,6 +364,32 @@
break;
}
+ case MP_RAILWAY_BRIDGE: {
+ TrackBits trackbits = GetTrackBits(tile);
+
+ /* The track the user is seeking to remove is not there */
+ if ((trackbits & trackbit) == 0) return CMD_ERROR;
+
+ trackbits ^= trackbit; /* configuration after removal */
+ /* For the time being, we make sure that the bridge has some kind of exit */
+ switch (GetBridgeRampDirection(tile)) {
+ case DIAGDIR_NE:
+ if ((trackbits & TRACK_BIT_3WAY_NE) == 0) return CMD_ERROR;
+ break;
+ case DIAGDIR_SE:
+ if ((trackbits & TRACK_BIT_3WAY_SE) == 0) return CMD_ERROR;
+ break;
+ case DIAGDIR_SW:
+ if ((trackbits & TRACK_BIT_3WAY_SW) == 0) return CMD_ERROR;
+ break;
+ case DIAGDIR_NW:
+ if ((trackbits & TRACK_BIT_3WAY_NW) == 0) return CMD_ERROR;
+ break;
+ default:
+ NOT_REACHED();
+ }
+ } /* Fall through */
+
case MP_RAILWAY: {
TrackBits present;