summaryrefslogtreecommitdiff
path: root/src/yapf
diff options
context:
space:
mode:
Diffstat (limited to 'src/yapf')
-rw-r--r--src/yapf/follow_track.hpp8
-rw-r--r--src/yapf/yapf.hpp1
-rw-r--r--src/yapf/yapf_costbase.hpp2
3 files changed, 6 insertions, 5 deletions
diff --git a/src/yapf/follow_track.hpp b/src/yapf/follow_track.hpp
index 75fff5109..1b1fc2bfb 100644
--- a/src/yapf/follow_track.hpp
+++ b/src/yapf/follow_track.hpp
@@ -78,7 +78,7 @@ protected:
// extra handling for tunnels in our direction
if (IsTunnelTile(m_old_tile)) {
- DiagDirection tunnel_enterdir = GetTunnelDirection(m_old_tile);
+ DiagDirection tunnel_enterdir = GetTunnelBridgeDirection(m_old_tile);
if (tunnel_enterdir == m_exitdir) {
// we are entering the tunnel
FindLengthOfTunnelResult flotr = FindLengthOfTunnel(m_old_tile, m_exitdir);
@@ -92,7 +92,7 @@ protected:
// extra handling for bridge ramp in our direction
if (IsBridgeTile(m_old_tile)) {
- DiagDirection bridge_enterdir = GetBridgeRampDirection(m_old_tile);
+ DiagDirection bridge_enterdir = GetTunnelBridgeDirection(m_old_tile);
if (bridge_enterdir == m_exitdir) {
// we are entering the bridge ramp
m_new_tile = GetOtherBridgeEnd(m_old_tile);
@@ -208,7 +208,7 @@ protected:
if (!IsWaterTT() && IsTileType(m_new_tile, MP_TUNNELBRIDGE)) {
if (IsTunnel(m_new_tile)) {
if (!m_is_tunnel) {
- DiagDirection tunnel_enterdir = GetTunnelDirection(m_new_tile);
+ DiagDirection tunnel_enterdir = GetTunnelBridgeDirection(m_new_tile);
if (tunnel_enterdir != m_exitdir) {
m_err = EC_NO_WAY;
return false;
@@ -216,7 +216,7 @@ protected:
}
} else if (IsBridge(m_new_tile)) {
if (!m_is_bridge) {
- DiagDirection ramp_enderdir = GetBridgeRampDirection(m_new_tile);
+ DiagDirection ramp_enderdir = GetTunnelBridgeDirection(m_new_tile);
if (ramp_enderdir != m_exitdir) {
m_err = EC_NO_WAY;
return false;
diff --git a/src/yapf/yapf.hpp b/src/yapf/yapf.hpp
index f98a7c607..2bbbc0a7a 100644
--- a/src/yapf/yapf.hpp
+++ b/src/yapf/yapf.hpp
@@ -12,6 +12,7 @@
#include "../road_map.h"
#include "../tunnel_map.h"
#include "../bridge_map.h"
+#include "../tunnelbridge_map.h"
#include "../bridge.h"
#include "../station.h"
#include "../station_map.h"
diff --git a/src/yapf/yapf_costbase.hpp b/src/yapf/yapf_costbase.hpp
index df4d9e787..2793aab9f 100644
--- a/src/yapf/yapf_costbase.hpp
+++ b/src/yapf/yapf_costbase.hpp
@@ -11,7 +11,7 @@ struct CYapfCostBase {
if (IsDiagonalTrackdir(td)) {
if (IsBridgeTile(tile)) {
// it is bridge ramp, check if we are entering the bridge
- if (GetBridgeRampDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are living it, no penalty
+ if (GetTunnelBridgeDirection(tile) != TrackdirToExitdir(td)) return false; // no, we are living it, no penalty
// we are entering the bridge
// if the tile slope is downwards, then bridge ramp has not upward slope
uint tile_slope = GetTileSlope(tile, NULL) & 0x0F;