mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r16087) -Fix (r16079): slow trains wouldn't crash into eachother anymore
This commit is contained in:
parent
b66783afab
commit
2a2b40461d
@ -4372,16 +4372,16 @@ static void TrainLocoHandler(Vehicle *v, bool mode)
|
||||
} else {
|
||||
TrainCheckIfLineEnds(v);
|
||||
/* Loop until the train has finished moving. */
|
||||
do {
|
||||
for (;;) {
|
||||
j -= adv_spd;
|
||||
TrainController(v, NULL);
|
||||
|
||||
/* Don't continue to move if the train crashed. */
|
||||
if (CheckTrainCollision(v)) break;
|
||||
/* 192 spd used for going straight, 256 for going diagonally. */
|
||||
adv_spd = (v->direction & 1) ? 192 : 256;
|
||||
|
||||
if (j >= adv_spd) {
|
||||
/* Don't continue to move if the train crashed or isn't moving. */
|
||||
if (CheckTrainCollision(v) || v->cur_speed == 0) break;
|
||||
/* No more moving this tick */
|
||||
if (j < adv_spd || v->cur_speed == 0) break;
|
||||
|
||||
OrderType order_type = v->current_order.GetType();
|
||||
/* Do not skip waypoints (incl. 'via' stations) when passing through at full speed. */
|
||||
@ -4394,7 +4394,6 @@ static void TrainLocoHandler(Vehicle *v, bool mode)
|
||||
ProcessOrders(v);
|
||||
}
|
||||
}
|
||||
} while (j >= adv_spd);
|
||||
SetLastSpeed(v, v->cur_speed);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user