1
0
Fork 0

(svn r19144) [1.0] -Fix [FS#3569]: under certain circumstances one could crash a competitor's train

release/1.0
rubidium 2010-02-16 00:09:43 +00:00
parent 9a4fd32e87
commit 6c86fa768c
1 changed files with 3 additions and 0 deletions

View File

@ -3167,6 +3167,9 @@ static Vehicle *FindTrainCollideEnum(Vehicle *v, void *data)
/* not a train or in depot */
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 */
Train *coll = Train::From(v)->First();