mirror of https://github.com/OpenTTD/OpenTTD
(svn r19144) [1.0] -Fix [FS#3569]: under certain circumstances one could crash a competitor's train
parent
9a4fd32e87
commit
6c86fa768c
|
@ -3167,6 +3167,9 @@ static Vehicle *FindTrainCollideEnum(Vehicle *v, void *data)
|
||||||
/* not a train or in depot */
|
/* not a train or in depot */
|
||||||
if (v->type != VEH_TRAIN || Train::From(v)->track == TRACK_BIT_DEPOT) return NULL;
|
if (v->type != VEH_TRAIN || Train::From(v)->track == TRACK_BIT_DEPOT) return NULL;
|
||||||
|
|
||||||
|
/* do not crash into trains of another company. */
|
||||||
|
if (v->owner != tcc->v->owner) return NULL;
|
||||||
|
|
||||||
/* get first vehicle now to make most usual checks faster */
|
/* get first vehicle now to make most usual checks faster */
|
||||||
Train *coll = Train::From(v)->First();
|
Train *coll = Train::From(v)->First();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue