summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2010-11-10 23:16:28 +0000
committerrubidium <rubidium@openttd.org>2010-11-10 23:16:28 +0000
commit65e6c9fd12b0ac3fc25934c14771412a6a5538bd (patch)
tree351ee015a520ca9e1256df4b2553426bc51b647b
parentb50aeb9552f8b5d35ea2f5f667cc100cf3832b88 (diff)
downloadopenttd-65e6c9fd12b0ac3fc25934c14771412a6a5538bd.tar.xz
(svn r21141) -Codechange: Use the new 'frame' variable for the bridge entry code as well (Hirundo)
-rw-r--r--src/tunnelbridge_cmd.cpp9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index 21882f003..9bbef4bc9 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -1592,13 +1592,8 @@ static VehicleEnterTileStatus VehicleEnter_TunnelBridge(Vehicle *v, TileIndex ti
}
if (vdir == dir) {
- switch (dir) {
- default: NOT_REACHED();
- case DIAGDIR_NE: if ((x & 0xF) != 0) return VETSB_CONTINUE; break;
- case DIAGDIR_SE: if ((y & 0xF) != TILE_SIZE - 1) return VETSB_CONTINUE; break;
- case DIAGDIR_SW: if ((x & 0xF) != TILE_SIZE - 1) return VETSB_CONTINUE; break;
- case DIAGDIR_NW: if ((y & 0xF) != 0) return VETSB_CONTINUE; break;
- }
+ /* Vehicle enters bridge at the last frame inside this tile. */
+ if (frame != TILE_SIZE - 1) return VETSB_CONTINUE;
switch (v->type) {
case VEH_TRAIN: {
Train *t = Train::From(v);