diff options
author | smatz <smatz@openttd.org> | 2008-01-23 22:34:04 +0000 |
---|---|---|
committer | smatz <smatz@openttd.org> | 2008-01-23 22:34:04 +0000 |
commit | 5a7c9037709772e4678ee57d9b42f5332bd66f97 (patch) | |
tree | ae76a3390a465cf3bfc011e2b32d53d5ae55c298 /src/elrail.cpp | |
parent | b5641ae0f2ca3723af7fe7f68c4ac45e113e8421 (diff) | |
download | openttd-5a7c9037709772e4678ee57d9b42f5332bd66f97.tar.xz |
(svn r11968) -Codechange: remove redundant FindLengthOfTunnel(), use GetTunnelBridgeLength() and/or GetOtherTunnelEnd() instead
Diffstat (limited to 'src/elrail.cpp')
-rw-r--r-- | src/elrail.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/elrail.cpp b/src/elrail.cpp index 154590b9b..0e429e04e 100644 --- a/src/elrail.cpp +++ b/src/elrail.cpp @@ -64,6 +64,7 @@ #include "tunnelbridge_map.h" #include "vehicle_func.h" #include "player_base.h" +#include "tunnelbridge.h" #include "table/sprites.h" #include "table/elrail_data.h" @@ -383,8 +384,8 @@ static void DrawCatenaryOnBridge(const TileInfo *ti) TileIndex end = GetSouthernBridgeEnd(ti->tile); TileIndex start = GetOtherBridgeEnd(end); - uint length = GetBridgeLength(start, end); - uint num = DistanceMax(ti->tile, start); + uint length = GetTunnelBridgeLength(start, end); + uint num = GetTunnelBridgeLength(ti->tile, start) + 1; uint height; const SortableSpriteStruct *sss; @@ -421,7 +422,7 @@ static void DrawCatenaryOnBridge(const TileInfo *ti) } /* need a pylon on the southern end of the bridge */ - if (DistanceMax(ti->tile, start) == length) { + if (GetTunnelBridgeLength(ti->tile, start) + 1 == length) { DiagDirection PCPpos = (axis == AXIS_X ? DIAGDIR_SW : DIAGDIR_SE); Direction PPPpos = (axis == AXIS_X ? DIR_NW : DIR_NE); if (HasBit(tlg, (axis == AXIS_X ? 0 : 1))) PPPpos = ReverseDir(PPPpos); |