diff options
author | frosch <frosch@openttd.org> | 2009-03-29 18:20:02 +0000 |
---|---|---|
committer | frosch <frosch@openttd.org> | 2009-03-29 18:20:02 +0000 |
commit | c2ced41c044946dbc3dbfe0471816fc9d63401f1 (patch) | |
tree | 16ca20dc58d1a49940b53495b1483f2da05c0a0e /src/yapf | |
parent | a052191aca47887de7aee3f24aacc5e0cc3215fd (diff) | |
download | openttd-c2ced41c044946dbc3dbfe0471816fc9d63401f1.tar.xz |
(svn r15891) -Fix (r13464): YAPF used different penalties for aqueducts than for other water tiles.
Diffstat (limited to 'src/yapf')
-rw-r--r-- | src/yapf/yapf_common.hpp | 2 | ||||
-rw-r--r-- | src/yapf/yapf_ship.cpp | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/src/yapf/yapf_common.hpp b/src/yapf/yapf_common.hpp index 43fdb6886..a0725a1ff 100644 --- a/src/yapf/yapf_common.hpp +++ b/src/yapf/yapf_common.hpp @@ -160,7 +160,7 @@ public: int dy = abs(y1 - y2); int dmin = min(dx, dy); int dxy = abs(dx - dy); - int d = dmin * 7 + (dxy - 1) * (10 / 2); + int d = dmin * YAPF_TILE_CORNER_LENGTH + (dxy - 1) * (YAPF_TILE_LENGTH / 2); n.m_estimate = n.m_cost + d; assert(n.m_estimate >= n.m_parent->m_estimate); return true; diff --git a/src/yapf/yapf_ship.cpp b/src/yapf/yapf_ship.cpp index 901545838..36b0b0076 100644 --- a/src/yapf/yapf_ship.cpp +++ b/src/yapf/yapf_ship.cpp @@ -113,11 +113,11 @@ public: FORCEINLINE bool PfCalcCost(Node& n, const TrackFollower *tf) { /* base tile cost depending on distance */ - int c = IsDiagonalTrackdir(n.GetTrackdir()) ? 10 : 7; + int c = IsDiagonalTrackdir(n.GetTrackdir()) ? YAPF_TILE_LENGTH : YAPF_TILE_CORNER_LENGTH; /* additional penalty for curves */ if (n.m_parent != NULL && n.GetTrackdir() != NextTrackdir(n.m_parent->GetTrackdir())) { /* new trackdir does not match the next one when going straight */ - c += 10; + c += YAPF_TILE_LENGTH; } c += YAPF_TILE_LENGTH * tf->m_tiles_skipped; |