diff options
-rw-r--r-- | src/newgrf_engine.cpp | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/newgrf_engine.cpp b/src/newgrf_engine.cpp index e3dc059ff..d67a5c118 100644 --- a/src/newgrf_engine.cpp +++ b/src/newgrf_engine.cpp @@ -609,12 +609,18 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object, switch (v->type) { case VEH_TRAIN: { RailType rt = GetTileRailType(v->tile); - return (HasPowerOnRail(Train::From(v)->railtype, rt) ? 0x100 : 0) | GetReverseRailTypeTranslation(rt, object->ro.grffile); + const RailtypeInfo *rti = GetRailTypeInfo(rt); + return ((rti->flags & RTFB_CATENARY) ? 0x200 : 0) | + (HasPowerOnRail(Train::From(v)->railtype, rt) ? 0x100 : 0) | + GetReverseRailTypeTranslation(rt, object->ro.grffile); } case VEH_ROAD: { RoadType rt = GetRoadType(v->tile, GetRoadTramType(RoadVehicle::From(v)->roadtype)); - return 0x100 | GetReverseRoadTypeTranslation(rt, object->ro.grffile); + const RoadTypeInfo *rti = GetRoadTypeInfo(rt); + return ((rti->flags & ROTFB_CATENARY) ? 0x200 : 0) | + 0x100 | + GetReverseRoadTypeTranslation(rt, object->ro.grffile); } default: |