From 6c86fa768cf12d0a909e8a2ba3541769d6ed1367 Mon Sep 17 00:00:00 2001 From: rubidium Date: Tue, 16 Feb 2010 00:09:43 +0000 Subject: [PATCH] (svn r19144) [1.0] -Fix [FS#3569]: under certain circumstances one could crash a competitor's train --- src/train_cmd.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/train_cmd.cpp b/src/train_cmd.cpp index 0f2ae36b22..2b8861ca48 100644 --- a/src/train_cmd.cpp +++ b/src/train_cmd.cpp @@ -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();