1
0
Fork 0

Compare commits

...

3 Commits

2 changed files with 12 additions and 1 deletions

View File

@ -84,7 +84,7 @@ struct EnginePreviewWindow : Window {
/* Get size of engine sprite, on loan from depot_gui.cpp */ /* Get size of engine sprite, on loan from depot_gui.cpp */
EngineID engine = static_cast<EngineID>(this->window_number); EngineID engine = static_cast<EngineID>(this->window_number);
EngineImageType image_type = EIT_PURCHASE; EngineImageType image_type = EIT_PREVIEW;
uint x, y; uint x, y;
int x_offs, y_offs; int x_offs, y_offs;

View File

@ -709,6 +709,17 @@ static uint32_t VehicleGetVariable(Vehicle *v, const VehicleScopeResolver *objec
return count; return count;
} }
case 0x65:
if (v->type == VEH_TRAIN) {
RailType rt = GetRailType(v->tile);
return GetBadgeVariableResult(*object->ro.grffile, GetRailTypeInfo(rt)->badges, parameter);
}
if (v->type == VEH_ROAD) {
RoadType rt = GetRoadType(v->tile, GetRoadTramType(RoadVehicle::From(v)->roadtype));
return GetBadgeVariableResult(*object->ro.grffile, GetRoadTypeInfo(rt)->badges, parameter);
}
return UINT_MAX;
case 0x7A: return GetBadgeVariableResult(*object->ro.grffile, v->GetEngine()->badges, parameter); case 0x7A: return GetBadgeVariableResult(*object->ro.grffile, v->GetEngine()->badges, parameter);
case 0xFE: case 0xFE: