summaryrefslogtreecommitdiff
path: root/train_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-23 19:35:36 +0000
committertron <tron@openttd.org>2006-04-23 19:35:36 +0000
commitc1dc517dab10acb049f35e80f94508bbcecf3193 (patch)
tree020949ed699a5b1e636d9d4da8e68db3751bf261 /train_cmd.c
parent8ef2c13c65498dfc39cb80bd1c07589b747fe1e6 (diff)
downloadopenttd-c1dc517dab10acb049f35e80f94508bbcecf3193.tar.xz
(svn r4554) Replace magic numbers by TILE_{HEIGHT,SIZE}
Diffstat (limited to 'train_cmd.c')
-rw-r--r--train_cmd.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/train_cmd.c b/train_cmd.c
index f29426ced..0567cee0d 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -2615,7 +2615,7 @@ static bool CheckCompatibleRail(const Vehicle *v, TileIndex tile)
Slope tileh = GetTileSlope(tile, &height);
// correct Z position of a train going under a bridge on slopes
- if (CorrectZ(tileh)) height += 8;
+ if (CorrectZ(tileh)) height += TILE_HEIGHT;
if (v->z_pos != height) return true; // train is going over bridge
}
@@ -3236,7 +3236,7 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
if (GB(ts, 0, 16) != 0) {
/* If we approach a rail-piece which we can't enter, or the back of a depot, don't enter it! */
- if (x + 4 > 15 &&
+ if (x + 4 >= TILE_SIZE &&
(!CheckCompatibleRail(v, tile) ||
(IsTileDepotType(tile, TRANSPORT_RAIL) &&
GetRailDepotDirection(tile) == dir))) {
@@ -3255,7 +3255,7 @@ static bool TrainCheckIfLineEnds(Vehicle *v)
}
return true;
}
- } else if (x + 4 > 15) {
+ } else if (x + 4 >= TILE_SIZE) {
v->cur_speed = 0;
ReverseTrainDirection(v);
return false;