mirror of https://github.com/OpenTTD/OpenTTD
Change: Rename end segment reason for general platforms.
parent
7ab28f6045
commit
fe1b0f1204
|
@ -446,7 +446,7 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
|
||||||
* if it is pass-through station (not our destination). */
|
* if it is pass-through station (not our destination). */
|
||||||
segment_cost += Yapf().PfGetSettings().rail_station_penalty * platform_length;
|
segment_cost += Yapf().PfGetSettings().rail_station_penalty * platform_length;
|
||||||
/* We will end in this pass (station is possible target) */
|
/* We will end in this pass (station is possible target) */
|
||||||
end_segment_reason |= ESRB_STATION;
|
end_segment_reason |= ESRB_PLATFORM;
|
||||||
|
|
||||||
} else if (TrackFollower::DoTrackMasking() && cur.tile_type == MP_RAILWAY) {
|
} else if (TrackFollower::DoTrackMasking() && cur.tile_type == MP_RAILWAY) {
|
||||||
/* Searching for a safe tile? */
|
/* Searching for a safe tile? */
|
||||||
|
@ -591,7 +591,7 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Platform-length penalty. */
|
/* Platform-length penalty. */
|
||||||
if ((end_segment_reason & ESRB_STATION) != ESRB_NONE) {
|
if ((end_segment_reason & ESRB_PLATFORM) != ESRB_NONE) {
|
||||||
assert(HasStationTileRail(n.GetLastTile()) || IsExtendedRailDepotTile(n.GetLastTile()));
|
assert(HasStationTileRail(n.GetLastTile()) || IsExtendedRailDepotTile(n.GetLastTile()));
|
||||||
uint platform_length = GetPlatformLength(n.GetLastTile(), ReverseDiagDir(TrackdirToExitdir(n.GetLastTrackdir())));
|
uint platform_length = GetPlatformLength(n.GetLastTile(), ReverseDiagDir(TrackdirToExitdir(n.GetLastTrackdir())));
|
||||||
/* Reduce the extra cost caused by passing-platform penalty (each platform receives it in the segment cost). */
|
/* Reduce the extra cost caused by passing-platform penalty (each platform receives it in the segment cost). */
|
||||||
|
|
|
@ -23,7 +23,7 @@ enum EndSegmentReason {
|
||||||
ESR_CHOICE_FOLLOWS, ///< the next tile contains a choice (the track splits to more than one segments)
|
ESR_CHOICE_FOLLOWS, ///< the next tile contains a choice (the track splits to more than one segments)
|
||||||
ESR_DEPOT, ///< stop in the depot (could be a target next time)
|
ESR_DEPOT, ///< stop in the depot (could be a target next time)
|
||||||
ESR_WAYPOINT, ///< waypoint encountered (could be a target next time)
|
ESR_WAYPOINT, ///< waypoint encountered (could be a target next time)
|
||||||
ESR_STATION, ///< station encountered (could be a target next time)
|
ESR_PLATFORM, ///< platform (station/extended depot) encountered (could be a target next time)
|
||||||
ESR_SAFE_TILE, ///< safe waiting position found (could be a target)
|
ESR_SAFE_TILE, ///< safe waiting position found (could be a target)
|
||||||
|
|
||||||
/* The following reasons are used only internally by PfCalcCost().
|
/* The following reasons are used only internally by PfCalcCost().
|
||||||
|
@ -47,7 +47,7 @@ enum EndSegmentReasonBits {
|
||||||
ESRB_CHOICE_FOLLOWS = 1 << ESR_CHOICE_FOLLOWS,
|
ESRB_CHOICE_FOLLOWS = 1 << ESR_CHOICE_FOLLOWS,
|
||||||
ESRB_DEPOT = 1 << ESR_DEPOT,
|
ESRB_DEPOT = 1 << ESR_DEPOT,
|
||||||
ESRB_WAYPOINT = 1 << ESR_WAYPOINT,
|
ESRB_WAYPOINT = 1 << ESR_WAYPOINT,
|
||||||
ESRB_STATION = 1 << ESR_STATION,
|
ESRB_PLATFORM = 1 << ESR_PLATFORM,
|
||||||
ESRB_SAFE_TILE = 1 << ESR_SAFE_TILE,
|
ESRB_SAFE_TILE = 1 << ESR_SAFE_TILE,
|
||||||
|
|
||||||
ESRB_PATH_TOO_LONG = 1 << ESR_PATH_TOO_LONG,
|
ESRB_PATH_TOO_LONG = 1 << ESR_PATH_TOO_LONG,
|
||||||
|
@ -58,10 +58,10 @@ enum EndSegmentReasonBits {
|
||||||
/* Additional (composite) values. */
|
/* Additional (composite) values. */
|
||||||
|
|
||||||
/* What reasons mean that the target can be found and needs to be detected. */
|
/* What reasons mean that the target can be found and needs to be detected. */
|
||||||
ESRB_POSSIBLE_TARGET = ESRB_DEPOT | ESRB_WAYPOINT | ESRB_STATION | ESRB_SAFE_TILE,
|
ESRB_POSSIBLE_TARGET = ESRB_DEPOT | ESRB_WAYPOINT | ESRB_PLATFORM | ESRB_SAFE_TILE,
|
||||||
|
|
||||||
/* What reasons can be stored back into cached segment. */
|
/* What reasons can be stored back into cached segment. */
|
||||||
ESRB_CACHED_MASK = ESRB_DEAD_END | ESRB_RAIL_TYPE | ESRB_INFINITE_LOOP | ESRB_SEGMENT_TOO_LONG | ESRB_CHOICE_FOLLOWS | ESRB_DEPOT | ESRB_WAYPOINT | ESRB_STATION | ESRB_SAFE_TILE,
|
ESRB_CACHED_MASK = ESRB_DEAD_END | ESRB_RAIL_TYPE | ESRB_INFINITE_LOOP | ESRB_SEGMENT_TOO_LONG | ESRB_CHOICE_FOLLOWS | ESRB_DEPOT | ESRB_WAYPOINT | ESRB_PLATFORM | ESRB_SAFE_TILE,
|
||||||
|
|
||||||
/* Reasons to abort pathfinding in this direction. */
|
/* Reasons to abort pathfinding in this direction. */
|
||||||
ESRB_ABORT_PF_MASK = ESRB_DEAD_END | ESRB_PATH_TOO_LONG | ESRB_INFINITE_LOOP | ESRB_FIRST_TWO_WAY_RED,
|
ESRB_ABORT_PF_MASK = ESRB_DEAD_END | ESRB_PATH_TOO_LONG | ESRB_INFINITE_LOOP | ESRB_FIRST_TWO_WAY_RED,
|
||||||
|
|
Loading…
Reference in New Issue