# HG changeset patch # User celestar # Date 2006-04-05 19:08:09 # Node ID 496342f11d8d815b4ef1240ecfb2477df6e5ae3a # Parent 602e60e8ee9aab7902309799260a73f105b81e48 (svn r4290) -Fix: fixed power computation for mixed consists on level crossings (michi_cc) diff --git a/train_cmd.c b/train_cmd.c --- 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;