diff options
author | tron <tron@openttd.org> | 2006-02-23 08:20:28 +0000 |
---|---|---|
committer | tron <tron@openttd.org> | 2006-02-23 08:20:28 +0000 |
commit | 2f8e3dcc05eea3bedbfcbf3e8bedaf7f64dc9cc3 (patch) | |
tree | 902fe3272275a4a3b554d21b247e7f5811687ebe /tunnelbridge_cmd.c | |
parent | d239ec0e967b3f078c1c09cdd9fae05c0771e840 (diff) | |
download | openttd-2f8e3dcc05eea3bedbfcbf3e8bedaf7f64dc9cc3.tar.xz |
(svn r3658) Add functions and symbolic names to retrieve road tile types and road pieces
Diffstat (limited to 'tunnelbridge_cmd.c')
-rw-r--r-- | tunnelbridge_cmd.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/tunnelbridge_cmd.c b/tunnelbridge_cmd.c index 0add73c77..5f9a9beba 100644 --- a/tunnelbridge_cmd.c +++ b/tunnelbridge_cmd.c @@ -7,6 +7,7 @@ #include "stdafx.h" #include "openttd.h" +#include "road.h" #include "table/sprites.h" #include "table/strings.h" #include "functions.h" @@ -352,7 +353,10 @@ int32 CmdBuildBridge(int x, int y, uint32 flags, uint32 p1, uint32 p2) break; case MP_STREET: - if (ti.map5 != (direction == 0 ? 5 : 10)) goto not_valid_below; + if (GetRoadType(ti.tile) != ROAD_NORMAL || + GetRoadBits(ti.tile) != (direction == 0 ? ROAD_Y : ROAD_X)) { + goto not_valid_below; + } m5 = 0xE8; break; |