Changeset - r3455:496342f11d8d
[Not reviewed]
master
0 1 0
celestar - 19 years ago 2006-04-05 19:08:09
celestar@openttd.org
(svn r4290) -Fix: fixed power computation for mixed consists on level crossings (michi_cc)
1 file changed with 3 insertions and 0 deletions:
0 comments (0 inline, 0 general)
train_cmd.c
Show inline comments
 
@@ -89,12 +89,15 @@ void TrainPowerChanged(Vehicle* v)
 
		/* Power is not added for articulated parts */
 
		if (IsArticulatedPart(u)) continue;
 

	
 
		if (IsBridgeTile(u->tile) && IsBridgeMiddle(u->tile) && DiagDirToAxis(DirToDiagDir(u->direction)) == GetBridgeAxis(u->tile)) {
 
			if (!HasPowerOnRail(u->u.rail.railtype, GetRailTypeOnBridge(u->tile))) engine_has_power = false;
 
			if (!HasPowerOnRail(v->u.rail.railtype, GetRailTypeOnBridge(u->tile))) wagon_has_power = false;
 
		} else if (IsLevelCrossing(u->tile)) {
 
			if (!HasPowerOnRail(u->u.rail.railtype, GetRailTypeCrossing(u->tile)))	engine_has_power = false;
 
			if (!HasPowerOnRail(v->u.rail.railtype, GetRailTypeCrossing(u->tile)))	wagon_has_power = false;
 
		} else {
 
			if (!HasPowerOnRail(u->u.rail.railtype, GetRailType(u->tile))) engine_has_power = false;
 
			if (!HasPowerOnRail(v->u.rail.railtype, GetRailType(u->tile))) wagon_has_power = false;
 
		}
 

	
 
		rvi_u = RailVehInfo(u->engine_type);
0 comments (0 inline, 0 general)