(svn r10491) -Fix [FS#988, YAPF]: When rail segment was cached using electric engine and it ended with non-electric rail it was incorrectly cached with the end reason ESRB_DEAD_END instead of ESRB_RAIL_TYPE. (Eddi)

- It caused YAPF to end prematurely there when it was searching for another path (for non-electric engine).
 - It can lead to sub-optimal path taken or 'train is lost' message.
 - In MP game it can also cause desync.
 - Uses changes made in r10489.
This commit is contained in:
KUDr 2007-07-09 18:57:12 +00:00
parent 25511e0e26
commit 3efc078e2f

View File

@ -378,7 +378,11 @@ no_entry_cost: // jump here at the beginning if the node has no parent (it is th
if (!tf_local.Follow(cur.tile, cur.td)) {
assert(tf_local.m_err != TrackFollower::EC_NONE);
/* Can't move to the next tile (EOL?). */
end_segment_reason |= ESRB_DEAD_END;
if (tf_local.m_err == TrackFollower::EC_RAIL_TYPE) {
end_segment_reason |= ESRB_RAIL_TYPE;
} else {
end_segment_reason |= ESRB_DEAD_END;
}
break;
}