summaryrefslogtreecommitdiff
path: root/src/slope.h
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2007-09-14 22:27:40 +0000
committerrubidium <rubidium@openttd.org>2007-09-14 22:27:40 +0000
commitfef64185b87e4517b7760e017171d646eaa1eb69 (patch)
tree66f89fc328e49813581c22632a0a9cb21d7c2eb8 /src/slope.h
parent5647bd5157b623348feb202623057fd84eb9c3c5 (diff)
downloadopenttd-fef64185b87e4517b7760e017171d646eaa1eb69.tar.xz
(svn r11107) -Feature: some tool so one can still build tunnels under rails (and other structures) when the owner of the structure built it on foundations and if you have enough "empty" space ofcourse. One could use the tool for some other construction needs too. Patch by frosch.
Diffstat (limited to 'src/slope.h')
-rw-r--r--src/slope.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/slope.h b/src/slope.h
index 0ed1c452c..dd04c24be 100644
--- a/src/slope.h
+++ b/src/slope.h
@@ -90,6 +90,19 @@ static inline byte GetHighestSlopeCorner(Slope s)
}
}
+/**
+ * Returns the height of the highest corner of a slope relative to TileZ (= minimal height)
+ *
+ * @param s The #Slope.
+ * @return Relative height of highest corner.
+ */
+static inline uint GetSlopeMaxZ(Slope s)
+{
+ if (s == SLOPE_FLAT) return 0;
+ if (IsSteepSlope(s)) return 2 * TILE_HEIGHT;
+ return TILE_HEIGHT;
+}
+
/**
* Enumeration for Foundations.