Slightly decrease proximity required for trains to crash.

This is to fix trains of different companies being able to crash when
two stations or line-ends are directly against each other.
pull/11/head
Jonathan G Rennison 8 years ago
parent 15dc498c79
commit 11e4bcee40

@ -3034,7 +3034,7 @@ static Vehicle *FindTrainCollideEnum(Vehicle *v, void *data)
/* Slower check using multiplication */
int min_diff = (Train::From(v)->gcache.cached_veh_length + 1) / 2 + (tcc->v->gcache.cached_veh_length + 1) / 2 - 1;
if (x_diff * x_diff + y_diff * y_diff > min_diff * min_diff) return NULL;
if (x_diff * x_diff + y_diff * y_diff >= min_diff * min_diff) return NULL;
/* Happens when there is a train under bridge next to bridge head */
if (abs(v->z_pos - tcc->v->z_pos) > 5) return NULL;

Loading…
Cancel
Save