mirror of https://github.com/OpenTTD/OpenTTD
Fix: Road vehicle blocking and train collissions used slightly inconsistent distance thresholds.
parent
3a70d1e2f7
commit
be39a05327
|
@ -553,9 +553,8 @@ static bool RoadVehCheckTrainCrash(RoadVehicle *v)
|
|||
|
||||
if (!IsLevelCrossingTile(tile)) continue;
|
||||
|
||||
if (HasVehicleNearTileXY(v->x_pos, v->y_pos, 6, [&u](const Vehicle *t) {
|
||||
return t->type == VEH_TRAIN && abs(t->z_pos - u->z_pos) <= 6 &&
|
||||
abs(t->x_pos - u->x_pos) <= 4 && abs(t->y_pos - u->y_pos) <= 4;
|
||||
if (HasVehicleNearTileXY(v->x_pos, v->y_pos, 4, [&u](const Vehicle *t) {
|
||||
return t->type == VEH_TRAIN && abs(t->z_pos - u->z_pos) <= 6;
|
||||
})) {
|
||||
RoadVehCrash(v);
|
||||
return true;
|
||||
|
@ -649,7 +648,7 @@ static RoadVehicle *RoadVehFindCloseTo(RoadVehicle *v, int x, int y, Direction d
|
|||
FindClosestBlockingRoadVeh(u, &rvf);
|
||||
}
|
||||
} else {
|
||||
for (Vehicle *u : VehiclesNearTileXY(x, y, 6)) {
|
||||
for (Vehicle *u : VehiclesNearTileXY(x, y, 8)) {
|
||||
FindClosestBlockingRoadVeh(u, &rvf);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -3228,7 +3228,7 @@ static bool CheckTrainCollision(Train *v)
|
|||
num_victims += CheckTrainCollision(u, v);
|
||||
}
|
||||
} else {
|
||||
for (Vehicle *u : VehiclesNearTileXY(v->x_pos, v->y_pos, 6)) {
|
||||
for (Vehicle *u : VehiclesNearTileXY(v->x_pos, v->y_pos, 7)) {
|
||||
num_victims += CheckTrainCollision(u, v);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue