mirror of https://github.com/OpenTTD/OpenTTD.git
Add: [NewGRF] Vehicle variable 4A now also returns, whether the current tile has catenary.
This commit is contained in:
parent
868d84bbfc
commit
f1bc4d8407
|
@ -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:
|
||||
|
|
Loading…
Reference in New Issue