Old revision #phoeeb6pa | New revision #pxmwekzc2 | ||
---|---|---|---|
1 | |||
2 | |||
3 | |||
4 | |||
5 | |||
6 | |||
7 | |||
8 | |||
9 | |||
10 | |||
11 | |||
12 | |||
13 | |||
14 | |||
15 | |||
16 | |||
17 | |||
18 | |||
19 | |||
20 | |||
21 | |||
22 | |||
23 | |||
24 | |||
25 | |||
26 | |||
27 | Index: src/pathfinder/yapf/yapf.h | 1 | Index: src/pathfinder/yapf/yapf.h |
28 | =================================================================== | 2 | =================================================================== |
29 | --- src/pathfinder/yapf/yapf.h (revision 27829) | 3 | --- src/pathfinder/yapf/yapf.h (revision 27829) | … | … |
127 | + /** Called by YAPF to detect if node ends in the desired destination */ | 101 | + /** Called by YAPF to detect if node ends in the desired destination */ |
128 | + inline bool PfDetectDestination(Node &n) | 102 | + inline bool PfDetectDestination(Node &n) |
129 | + { | 103 | + { |
130 | + bool bDest = IsShipDepotTile(n.m_segment_last_tile) | 130 | + bool bDest = IsShipDepotTile(n.m_segment_last_tile); |
131 | + return bDest; | 105 | + return bDest; |
132 | + } | 106 | + } |
133 | + | 107 | + |
134 | + inline bool PfDetectDestinationTile(TileIndex tile, Trackdir trackdir) | 108 | + inline bool PfDetectDestinationTile(TileIndex tile, Trackdir trackdir) |
135 | + { | 109 | + { |
136 | + return IsShipDepotTile( | 136 | + return IsShipDepotTile(tile); |
137 | + } | 111 | + } |
138 | + | 112 | + |
139 | + /** | 113 | + /** | … | … |
229 | - * other hand if we have set a maximum distance, any depot | 203 | - * other hand if we have set a maximum distance, any depot |
230 | - * further away than max_distance can safely be ignored. */ | 204 | - * further away than max_distance can safely be ignored. */ |
231 | - uint best_dist = max_distance == 0 ? UINT_MAX : max_distance + 1; | 205 | - uint best_dist = max_distance == 0 ? UINT_MAX : max_distance + 1; |
232 | + if (IsShipDepotTile(v->tile) | 232 | + if (IsShipDepotTile(v->tile)) return FindDepotData(v->tile, 0); |
233 | 207 | ||
234 | - FOR_ALL_DEPOTS(depot) { | 208 | - FOR_ALL_DEPOTS(depot) { |
235 | - TileIndex tile = depot->xy; | 209 | - TileIndex tile = depot->xy; |