Changeset - r16535:d1d8794e63d8
[Not reviewed]
master
0 1 0
rubidium - 14 years ago 2010-11-20 14:34:57
rubidium@openttd.org
(svn r21271) -Change: use the last red instead of last red exit penalty for making sure other waypoint entries are evaluated as well when they are occupied, e.g. when there are no signals before the waypoint but a train just beyond the waypoint is stopped (like for stations)
1 file changed with 5 insertions and 1 deletions:
0 comments (0 inline, 0 general)
src/pathfinder/yapf/yapf_costrail.hpp
Show inline comments
 
@@ -435,10 +435,14 @@ no_entry_cost: // jump here at the begin
 
						/* If this is a safe waiting position we're done searching for it */
 
						if (IsSafeWaitingPosition(v, t, td, true, _settings_game.pf.forbid_90_deg)) break;
 
					}
 

	
 
					/* In the case this platform is (possibly) occupied we add penalty so the
 
					 * other platforms of this waypoint are evaluated as well, i.e. we assume
 
					 * that there is a red signal in the waypoint when it's occupied. */
 
					if (td == INVALID_TRACKDIR ||
 
							!IsSafeWaitingPosition(v, t, td, true, _settings_game.pf.forbid_90_deg) ||
 
							!IsWaitingPositionFree(v, t, td, _settings_game.pf.forbid_90_deg)) {
 
						extra_cost += Yapf().PfGetSettings().rail_lastred_exit_penalty;
 
						extra_cost += Yapf().PfGetSettings().rail_lastred_penalty;
 
					}
 
				}
 
				/* Waypoint is also a good reason to finish. */
0 comments (0 inline, 0 general)