summaryrefslogtreecommitdiff
path: root/src/pathfinder/yapf/yapf_costrail.hpp
diff options
context:
space:
mode:
authorJ0anJosep <juanjo.ng.83@gmail.com>2018-05-12 18:19:40 +0200
committerfrosch <github@elsenhans.name>2018-06-27 23:14:30 +0200
commitd01c09fb73aacd1b3c204829e7c574bbde09153f (patch)
tree5327845c01eeba8864925a38d97ab210b58f1850 /src/pathfinder/yapf/yapf_costrail.hpp
parent31ac11bddb71945bba57d0cefac620f455963455 (diff)
downloadopenttd-d01c09fb73aacd1b3c204829e7c574bbde09153f.tar.xz
Codechange: Use HasTrack(dir) to improve code readability.
Diffstat (limited to 'src/pathfinder/yapf/yapf_costrail.hpp')
-rw-r--r--src/pathfinder/yapf/yapf_costrail.hpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/pathfinder/yapf/yapf_costrail.hpp b/src/pathfinder/yapf/yapf_costrail.hpp
index 5c5a7fbaf..022b9a167 100644
--- a/src/pathfinder/yapf/yapf_costrail.hpp
+++ b/src/pathfinder/yapf/yapf_costrail.hpp
@@ -104,7 +104,7 @@ public:
assert(IsValidTrackdir(td2));
int cost = 0;
if (TrackFollower::Allow90degTurns()
- && ((TrackdirToTrackdirBits(td2) & TrackdirCrossesTrackdirs(td1)) != TRACKDIR_BIT_NONE)) {
+ && HasTrackdir(TrackdirCrossesTrackdirs(td1), td2)) {
/* 90-deg curve penalty */
cost += Yapf().PfGetSettings().rail_curve90_penalty;
} else if (td2 != NextTrackdir(td1)) {
@@ -280,7 +280,7 @@ public:
{
assert(!n.flags_u.flags_s.m_targed_seen);
assert(tf->m_new_tile == n.m_key.m_tile);
- assert((TrackdirToTrackdirBits(n.m_key.m_td) & tf->m_new_td_bits) != TRACKDIR_BIT_NONE);
+ assert((HasTrackdir(tf->m_new_td_bits, n.m_key.m_td)));
CPerfStart perf_cost(Yapf().m_perf_cost);