Make look ahead distance vaiable with speed, within a reasonable range
This commit is contained in:
@@ -99,8 +99,8 @@ static bool CheckTrainStayInWormHolePathReserve(Train *t, TileIndex tile);
|
||||
* at the current position of the train is going to be invalid */
|
||||
static DateTicksScaled GetSpeedRestrictionTimeout(const Train *t)
|
||||
{
|
||||
const int64 look_ahead_distance = 16; // In tiles
|
||||
const int64 velocity = std::max<int64>(25, t->cur_speed);
|
||||
const int64 look_ahead_distance = Clamp(t->cur_speed / 8, 6, 16); // In tiles, varying between 6 and 16 depending on current speed
|
||||
|
||||
// This assumes travel along the X or Y map axis, not diagonally. See GetAdvanceDistance, GetAdvanceSpeed.
|
||||
const int64 ticks_per_tile = (192 * 16 * 4 / 3) / velocity;
|
||||
|
Reference in New Issue
Block a user