summaryrefslogtreecommitdiff
path: root/station_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 /station_cmd.c
parent8ef2c13c65498dfc39cb80bd1c07589b747fe1e6 (diff)
downloadopenttd-c1dc517dab10acb049f35e80f94508bbcecf3193.tar.xz
(svn r4554) Replace magic numbers by TILE_{HEIGHT,SIZE}
Diffstat (limited to 'station_cmd.c')
-rw-r--r--station_cmd.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/station_cmd.c b/station_cmd.c
index 08edf3eb3..801b292d8 100644
--- a/station_cmd.c
+++ b/station_cmd.c
@@ -809,7 +809,7 @@ int32 CheckFlatLandBelow(TileIndex tile, uint w, uint h, uint flags, uint invali
return_cmd_error(STR_0007_FLAT_LAND_REQUIRED);
}
cost += _price.terraform;
- flat_z += 8;
+ flat_z += TILE_HEIGHT;
}
// get corresponding flat level and make sure that all parts of the station have the same level.
@@ -2032,7 +2032,7 @@ void StationPickerDrawSprite(int x, int y, RailType railtype, int image)
static uint GetSlopeZ_Station(const TileInfo* ti)
{
- return ti->z + (ti->tileh == SLOPE_FLAT ? 0 : 8);
+ return ti->z + (ti->tileh == SLOPE_FLAT ? 0 : TILE_HEIGHT);
}
static Slope GetSlopeTileh_Station(TileIndex tile, Slope tileh)
@@ -2190,8 +2190,8 @@ static uint32 VehicleEnter_Station(Vehicle *v, TileIndex tile, int x, int y)
y &= 0xF;
if (DiagDirToAxis(dir) != AXIS_X) intswap(x, y);
- if (y == 8) {
- if (dir != DIAGDIR_SE && dir != DIAGDIR_SW) x = ~x & 0xF;
+ if (y == TILE_SIZE / 2) {
+ if (dir != DIAGDIR_SE && dir != DIAGDIR_SW) x = TILE_SIZE - 1 - x;
if (x == 12) return 2 | (station_id << 8); /* enter station */
if (x < 12) {
uint16 spd;