1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-12 09:09:09 +00:00

Feature: Add NotRoadTypes (NRT)

This commit is contained in:
2019-04-06 07:46:15 +01:00
committed by Michael Lutz
parent 21edf67f89
commit c02ef3e456
106 changed files with 4465 additions and 1245 deletions

View File

@@ -23,6 +23,7 @@
#include "station_base.h"
#include "company_base.h"
#include "newgrf_railtype.h"
#include "newgrf_roadtype.h"
#include "ship.h"
#include "safeguards.h"
@@ -606,11 +607,21 @@ static uint32 VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *object,
case 0x48: return v->GetEngine()->flags; // Vehicle Type Info
case 0x49: return v->build_year;
case 0x4A: {
if (v->type != VEH_TRAIN) return 0;
RailType rt = GetTileRailType(v->tile);
return (HasPowerOnRail(Train::From(v)->railtype, rt) ? 0x100 : 0) | GetReverseRailTypeTranslation(rt, object->ro.grffile);
}
case 0x4A:
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);
}
case VEH_ROAD: {
RoadType rt = GetRoadType(v->tile, GetRoadTramType(RoadVehicle::From(v)->roadtype));
return 0x100 | GetReverseRoadTypeTranslation(rt, object->ro.grffile);
}
default:
return 0;
}
case 0x4B: // Long date of last service
return v->date_of_last_service;