summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortruebrain <truebrain@openttd.org>2012-01-01 19:20:08 +0000
committertruebrain <truebrain@openttd.org>2012-01-01 19:20:08 +0000
commitcb414b09d2e803a9492781f9d23cd84b9890cc55 (patch)
tree08c70d4f124dfe91fab10e4a54866ac9af4dc654
parent62b00c1da8129138f5862d2364c75fe12bc523b0 (diff)
downloadopenttd-cb414b09d2e803a9492781f9d23cd84b9890cc55.tar.xz
(svn r23708) -Codechange: apply the same trick as r23701 to GetTileSlope(), gaining similar benefits
-rw-r--r--src/tile_map.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/tile_map.cpp b/src/tile_map.cpp
index a936b78e7..017bb5c56 100644
--- a/src/tile_map.cpp
+++ b/src/tile_map.cpp
@@ -22,8 +22,11 @@ Slope GetTileSlope(TileIndex tile, int *h)
{
assert(tile < MapSize());
- if (TileX(tile) == MapMaxX() || TileY(tile) == MapMaxY() ||
- (_settings_game.construction.freeform_edges && (TileX(tile) == 0 || TileY(tile) == 0))) {
+ uint x = TileX(tile);
+ uint y = TileY(tile);
+
+ if (x == MapMaxX() || y == MapMaxY() ||
+ ((x == 0 || y == 0) && _settings_game.construction.freeform_edges)) {
if (h != NULL) *h = TileHeight(tile);
return SLOPE_FLAT;
}