diff options
author | tron <tron@openttd.org> | 2006-03-15 16:44:50 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-03-15 16:44:50 +0000 |
commit | 3d9c76d8b81794ad2e13242eafca1022b6dfbca6 (patch) | |
tree | 64e50bf99a33465decab370d13970df72c292068 /bridge_map.c | |
parent | 962852b732e02e77438a4a9f8225f87f5009aa55 (diff) | |
download | openttd-3d9c76d8b81794ad2e13242eafca1022b6dfbca6.tar.xz |
(svn r3887) Add a function to get the other bridge end when you're at a bridge ramp
Diffstat (limited to 'bridge_map.c')
-rw-r--r-- | bridge_map.c | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/bridge_map.c b/bridge_map.c new file mode 100644 index 000000000..dbd6ac3f4 --- /dev/null +++ b/bridge_map.c @@ -0,0 +1,17 @@ +/* $Id$ */ + +#include "stdafx.h" +#include "openttd.h" +#include "bridge_map.h" + + +TileIndex GetOtherBridgeEnd(TileIndex tile) +{ + TileIndexDiff delta = TileOffsByDir(GetBridgeRampDirection(tile)); + + do { + tile += delta; + } while (!IsBridgeRamp(tile)); + + return tile; +} |