mirror of
https://github.com/JGRennison/OpenTTD-patches.git
synced 2024-11-04 06:00:15 +00:00
(svn r21800) -Fix [FS#3569]: under certain circumstances one could crash a competitor's train; take the lazy non-future proof version of the fix from the 1.0 branch as fixing the real bug is significantly more complex and might even break some backwards compatability if not done perfectly
This commit is contained in:
parent
8c421116d9
commit
c4b5a322e7
@ -2813,6 +2813,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
Block a user