summaryrefslogtreecommitdiff
path: root/src/tunnelbridge_cmd.cpp
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2011-11-04 11:30:37 +0000
committerrubidium <rubidium@openttd.org>2011-11-04 11:30:37 +0000
commit19eabdba2cf0184d5dc55cb3b9b8a7b5fe7ccfd3 (patch)
treee0fd85356bbcae38f6b50b8e7bc9470156b81e2d /src/tunnelbridge_cmd.cpp
parent643c54d288e091adf386bacd3615991e24e8909f (diff)
downloadopenttd-19eabdba2cf0184d5dc55cb3b9b8a7b5fe7ccfd3.tar.xz
(svn r23106) -Codechange: pass int* to GetTileSlope and friends
Diffstat (limited to 'src/tunnelbridge_cmd.cpp')
-rw-r--r--src/tunnelbridge_cmd.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/tunnelbridge_cmd.cpp b/src/tunnelbridge_cmd.cpp
index d07603f16..fd6b5f9c6 100644
--- a/src/tunnelbridge_cmd.cpp
+++ b/src/tunnelbridge_cmd.cpp
@@ -138,7 +138,7 @@ static inline const PalSpriteID *GetBridgeSpriteTable(int index, BridgePieces ta
* @param z TileZ corresponding to tileh, gets modified as well
* @return Error or cost for bridge foundation
*/
-static CommandCost CheckBridgeSlopeNorth(Axis axis, Slope *tileh, uint *z)
+static CommandCost CheckBridgeSlopeNorth(Axis axis, Slope *tileh, int *z)
{
Foundation f = GetBridgeFoundation(*tileh, axis);
*z += ApplyFoundationToSlope(f, tileh);
@@ -159,7 +159,7 @@ static CommandCost CheckBridgeSlopeNorth(Axis axis, Slope *tileh, uint *z)
* @param z TileZ corresponding to tileh, gets modified as well
* @return Error or cost for bridge foundation
*/
-static CommandCost CheckBridgeSlopeSouth(Axis axis, Slope *tileh, uint *z)
+static CommandCost CheckBridgeSlopeSouth(Axis axis, Slope *tileh, int *z)
{
Foundation f = GetBridgeFoundation(*tileh, axis);
*z += ApplyFoundationToSlope(f, tileh);
@@ -267,8 +267,8 @@ CommandCost CmdBuildBridge(TileIndex end_tile, DoCommandFlag flags, uint32 p1, u
if (bridge_len > _settings_game.construction.max_bridge_length) return_cmd_error(STR_ERROR_BRIDGE_TOO_LONG);
}
- uint z_start;
- uint z_end;
+ int z_start;
+ int z_end;
Slope tileh_start = GetTileSlope(tile_start, &z_start);
Slope tileh_end = GetTileSlope(tile_end, &z_end);
bool pbs_reservation = false;
@@ -525,8 +525,8 @@ CommandCost CmdBuildTunnel(TileIndex start_tile, DoCommandFlag flags, uint32 p1,
default: return CMD_ERROR;
}
- uint start_z;
- uint end_z;
+ int start_z;
+ int end_z;
Slope start_tileh = GetTileSlope(start_tile, &start_z);
DiagDirection direction = GetInclinedSlopeDirection(start_tileh);
if (direction == INVALID_DIAGDIR) return_cmd_error(STR_ERROR_SITE_UNSUITABLE_FOR_TUNNEL);
@@ -1361,7 +1361,7 @@ void DrawBridgeMiddle(const TileInfo *ti)
static uint GetSlopePixelZ_TunnelBridge(TileIndex tile, uint x, uint y)
{
- uint z;
+ int z;
Slope tileh = GetTilePixelSlope(tile, &z);
x &= 0xF;
@@ -1380,7 +1380,7 @@ static uint GetSlopePixelZ_TunnelBridge(TileIndex tile, uint x, uint y)
/* On the bridge ramp? */
if (5 <= pos && pos <= 10) {
- uint delta;
+ int delta;
if (tileh != SLOPE_FLAT) return z + TILE_HEIGHT;
@@ -1679,16 +1679,16 @@ static CommandCost TerraformTile_TunnelBridge(TileIndex tile, DoCommandFlag flag
DiagDirection direction = GetTunnelBridgeDirection(tile);
Axis axis = DiagDirToAxis(direction);
CommandCost res;
- uint z_old;
+ int z_old;
Slope tileh_old = GetTileSlope(tile, &z_old);
/* Check if new slope is valid for bridges in general (so we can safely call GetBridgeFoundation()) */
if ((direction == DIAGDIR_NW) || (direction == DIAGDIR_NE)) {
CheckBridgeSlopeSouth(axis, &tileh_old, &z_old);
- res = CheckBridgeSlopeSouth(axis, &tileh_new, &z_new);
+ res = CheckBridgeSlopeSouth(axis, &tileh_new, (int*)&z_new);
} else {
CheckBridgeSlopeNorth(axis, &tileh_old, &z_old);
- res = CheckBridgeSlopeNorth(axis, &tileh_new, &z_new);
+ res = CheckBridgeSlopeNorth(axis, &tileh_new, (int*)&z_new);
}
/* Surface slope is valid and remains unchanged? */