summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcelestar <celestar@openttd.org>2006-04-05 19:08:09 +0000
committercelestar <celestar@openttd.org>2006-04-05 19:08:09 +0000
commit07e4134ebdf59576ec3d69207e23d00929b416d5 (patch)
treefead159746ed4edb901567d6f3346f2dec8065dc
parentfcedc458f17a41459be9061833f2f9d70a14d9dc (diff)
downloadopenttd-07e4134ebdf59576ec3d69207e23d00929b416d5.tar.xz
(svn r4290) -Fix: fixed power computation for mixed consists on level crossings (michi_cc)
-rw-r--r--train_cmd.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/train_cmd.c b/train_cmd.c
index ca7e095f4..dbae80e3c 100644
--- a/train_cmd.c
+++ b/train_cmd.c
@@ -92,6 +92,9 @@ void TrainPowerChanged(Vehicle* v)
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;