diff options
author | michi_cc <michi_cc@openttd.org> | 2011-11-21 20:51:43 +0000 |
---|---|---|
committer | michi_cc <michi_cc@openttd.org> | 2011-11-21 20:51:43 +0000 |
commit | 4d2a9e384ccb83eec9992ad36459f495bfcfe60f (patch) | |
tree | 26d51a4b166e5dfeff2c1e2bbe753b73df80332b /src/direction_func.h | |
parent | 3748cab60876e98e530c514307e303a071498461 (diff) | |
download | openttd-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.h | 11 |
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 */ |