changeset 17063:9f041188fc49 draft

(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
author rubidium <rubidium@openttd.org>
date Sat, 15 Jan 2011 09:53:21 +0000
parents b3ff9bf3d385
children 23990d00e37d
files src/train_cmd.cpp
diffstat 1 files changed, 3 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/train_cmd.cpp
+++ b/src/train_cmd.cpp
@@ -2813,6 +2813,9 @@
 	/* 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();