summaryrefslogtreecommitdiff
path: root/tunnelbridge_cmd.c
diff options
context:
space:
mode:
authortron <tron@openttd.org>2006-04-10 12:36:04 +0000
committertron <tron@openttd.org>2006-04-10 12:36:04 +0000
commit7a3345f4dfacb7e09dfbd04d3b1ef98716ae64a9 (patch)
tree12fb7916b2b5ea56c7e9648fb5ecfb5d29b93161 /tunnelbridge_cmd.c
parent4fcd2f0643e3d5a729252fcb013eec77f532c232 (diff)
downloadopenttd-7a3345f4dfacb7e09dfbd04d3b1ef98716ae64a9.tar.xz
(svn r4344) Use tile coordinates or even TileIndices instead of virtual tile coordinates where it suffices.
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r--tunnelbridge_cmd.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c
index 712cfef6f..df7c8e594 100644
--- a/tunnelbridge_cmd.c
+++ b/tunnelbridge_cmd.c
@@ -216,10 +216,10 @@ int32 CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2)
transport = TRANSPORT_RAIL;
}
- x = TileX(end_tile) * TILE_SIZE;
- y = TileY(end_tile) * TILE_SIZE;
- sx = TileX(p1) * TILE_SIZE;
- sy = TileY(p1) * TILE_SIZE;
+ x = TileX(end_tile);
+ y = TileY(end_tile);
+ sx = TileX(p1);
+ sy = TileY(p1);
/* check if valid, and make sure that (x,y) are smaller than (sx,sy) */
if (x == sx) {
@@ -240,12 +240,12 @@ int32 CmdBuildBridge(TileIndex end_tile, uint32 flags, uint32 p1, uint32 p2)
}
/* set and test bridge length, availability */
- bridge_len = ((sx + sy - x - y) / TILE_SIZE) - 1;
+ bridge_len = (sx + sy - x - y) - 1;
if (!CheckBridge_Stuff(bridge_type, bridge_len)) return_cmd_error(STR_5015_CAN_T_BUILD_BRIDGE_HERE);
/* retrieve landscape height and ensure it's on land */
- tile_start = TileVirtXY(x, y);
- tile_end = TileVirtXY(sx, sy);
+ tile_start = TileXY(x, y);
+ tile_end = TileXY(sx, sy);
if ((IsTileType(tile_start, MP_WATER) && _m[tile_start].m5 == 0) ||
(IsTileType(tile_end, MP_WATER) && _m[tile_end].m5 == 0)) {
return_cmd_error(STR_02A0_ENDS_OF_BRIDGE_MUST_BOTH);