diff options
author | rubidium <rubidium@openttd.org> | 2011-11-04 10:31:13 +0000 |
---|---|---|
committer | rubidium <rubidium@openttd.org> | 2011-11-04 10:31:13 +0000 |
commit | a8c4efcff49b3377b9bdd748b33dbad2094f9eaa (patch) | |
tree | a99152d10f7956520cdcd9fc316ab3e6a537bb24 /src/object_cmd.cpp | |
parent | 1dc685aeea202f1677f915d390dc13ce3e18c462 (diff) | |
download | openttd-a8c4efcff49b3377b9bdd748b33dbad2094f9eaa.tar.xz |
(svn r23101) -Codechange: remove pointless multiplications by TILE_HEIGHT from the station/object building code
Diffstat (limited to 'src/object_cmd.cpp')
-rw-r--r-- | src/object_cmd.cpp | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/object_cmd.cpp b/src/object_cmd.cpp index 0eee6880e..a023162d6 100644 --- a/src/object_cmd.cpp +++ b/src/object_cmd.cpp @@ -230,7 +230,7 @@ CommandCost CmdBuildObject(TileIndex tile, DoCommandFlag flags, uint32 p1, uint3 /* So, now the surface is checked... check the slope of said surface. */ int allowed_z; - if (GetTilePixelSlope(tile, (uint*)&allowed_z) != SLOPE_FLAT) allowed_z += TILE_HEIGHT; + if (GetTileSlope(tile, (uint*)&allowed_z) != SLOPE_FLAT) allowed_z++; TILE_AREA_LOOP(t, ta) { uint16 callback = CALLBACK_FAILED; @@ -643,7 +643,7 @@ void GenerateObjects() TileIndex tile = RandomTile(); uint h; - if (IsTileType(tile, MP_CLEAR) && GetTilePixelSlope(tile, &h) == SLOPE_FLAT && h >= TILE_HEIGHT * 4 && !IsBridgeAbove(tile)) { + if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h >= 4 && !IsBridgeAbove(tile)) { TileIndex t = tile; if (CircularTileSearch(&t, 9, HasTransmitter, NULL)) continue; @@ -680,7 +680,7 @@ void GenerateObjects() for (int j = 0; j < 19; j++) { uint h; - if (IsTileType(tile, MP_CLEAR) && GetTilePixelSlope(tile, &h) == SLOPE_FLAT && h <= TILE_HEIGHT * 2 && !IsBridgeAbove(tile)) { + if (IsTileType(tile, MP_CLEAR) && GetTileSlope(tile, &h) == SLOPE_FLAT && h <= 2 && !IsBridgeAbove(tile)) { BuildObject(OBJECT_LIGHTHOUSE, tile); IncreaseGeneratingWorldProgress(GWP_OBJECT); lighthouses_to_build--; |