summaryrefslogtreecommitdiff
path: root/src/direction_func.h
diff options
context:
space:
mode:
authormichi_cc <michi_cc@openttd.org>2011-11-21 20:51:43 +0000
committermichi_cc <michi_cc@openttd.org>2011-11-21 20:51:43 +0000
commit4d2a9e384ccb83eec9992ad36459f495bfcfe60f (patch)
tree26d51a4b166e5dfeff2c1e2bbe753b73df80332b /src/direction_func.h
parent3748cab60876e98e530c514307e303a071498461 (diff)
downloadopenttd-4d2a9e384ccb83eec9992ad36459f495bfcfe60f.tar.xz
(svn r23290) -Fix [FS#2379,FS#3569]: Change the centre of train vehicles to depend on the vehicle length instead of being fixed at 4/8th of the original vehicle length to make sure shortened vehicles don't block tiles they shouldn't block.
Diffstat (limited to 'src/direction_func.h')
-rw-r--r--src/direction_func.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/direction_func.h b/src/direction_func.h
index f3b714a8e..bf92a9ad6 100644
--- a/src/direction_func.h
+++ b/src/direction_func.h
@@ -239,4 +239,15 @@ static inline bool IsValidAxis(Axis d)
return d < AXIS_END;
}
+/**
+ * Checks if a given Direction is diagonal.
+ *
+ * @param dir The given direction.
+ * @return True if the direction is diagonal.
+ */
+static inline bool IsDiagonalDirection(Direction dir)
+{
+ return (dir & 1) != 0;
+}
+
#endif /* DIRECTION_FUNC_H */