(svn r4479) -Fix (FS#90) electric engines (or rather their pantographs) no longer emit sparks when engine is pulled on convrail (MeusH)
authorcelestar
Wed, 19 Apr 2006 16:10:17 +0000
changeset 3590 215fc77ee7c6
parent 3589 9d646fb01e17
child 3591 a5febb93bc11
(svn r4479) -Fix (FS#90) electric engines (or rather their pantographs) no longer emit sparks when engine is pulled on convrail (MeusH)

P.S. Credit for previous commit goes to the bug reporter, nycom, who submitted the fix as well.
train_cmd.c
--- a/train_cmd.c	Wed Apr 19 16:02:07 2006 +0000
+++ b/train_cmd.c	Wed Apr 19 16:10:17 2006 +0000
@@ -1954,8 +1954,10 @@
 		}
 
 		// No smoke in depots or tunnels
-		if (IsTileDepotType(v->tile, TRANSPORT_RAIL) || IsTunnelTile(v->tile))
-			continue;
+		if (IsTileDepotType(v->tile, TRANSPORT_RAIL) || IsTunnelTile(v->tile)) continue;
+
+		// No sparks for electric vehicles on nonelectrified tracks
+		if (!HasPowerOnRail(v->u.rail.railtype, GetTileRailType(v->tile, GetVehicleTrackdir(v)))) continue;
 
 		if (effect_type == 0) {
 			// Use default effect type for engine class.