equal
deleted
inserted
replaced
1027 /* Vehicle will enter the bridge wormhole when it reaches the tile edge in the |
1027 /* Vehicle will enter the bridge wormhole when it reaches the tile edge in the |
1028 * direction of the bridge. */ |
1028 * direction of the bridge. */ |
1029 TileIndexDiffC diff = TileIndexDiffCByDiagDir(dir); |
1029 TileIndexDiffC diff = TileIndexDiffCByDiagDir(dir); |
1030 /* If vehicle didn't reach the edge we can return and try it next time */ |
1030 /* If vehicle didn't reach the edge we can return and try it next time */ |
1031 if (((diff.x != 0 ? x : y) & 0x0F) != (diff.x + diff.y > 0 ? TILE_SIZE - 1 : 0)) return 0; |
1031 if (((diff.x != 0 ? x : y) & 0x0F) != (diff.x + diff.y > 0 ? TILE_SIZE - 1 : 0)) return 0; |
|
1032 /* We will enter the bridge wormhole. Adjust the other coordinate to the middle of tile |
|
1033 * to allow train controller to select proper vehicle image */ |
|
1034 if (diff.x != 0) v->y_pos = y; else v->x_pos = x; |
1032 |
1035 |
1033 /* We're about to enter the bridge body, clear all up/down flags just in case */ |
1036 /* We're about to enter the bridge body, clear all up/down flags just in case */ |
1034 v->u.rail.track = 0x40; |
1037 v->u.rail.track = 0x40; |
1035 v->direction = DiagDirToDir(dir); |
1038 v->direction = DiagDirToDir(dir); |
1036 CLRBIT(v->u.rail.flags, VRF_GOINGUP); |
1039 CLRBIT(v->u.rail.flags, VRF_GOINGUP); |