I'm using this code to get the ExtVehicleType of a Vehicle:
public static ExtVehicleType ToExtVehicleType(this ref Vehicle vehicle) {
var vehicleId = vehicle.Info.m_instanceID.Vehicle;
var vehicleAI = vehicle.Info.m_vehicleAI;
var emergency = vehicle.m_flags.IsFlagSet(Vehicle.Flags.Emergency2);
var ret = ExtVehicleManager.Instance.DetermineVehicleTypeFromAIType(
vehicleId,
vehicleAI,
emergency);
return ret ?? ExtVehicleType.None;
}
As part of developing/testing PR #1341 I found the following issues (assuming I've not blundered somewhere):
ExtVehicleType.PassengerCar does not include tourist cars
ExtVehicleType.Service does not include things like Garbage (not sure if Vanilla or Sunset Harbor) / Maintenance (Snowfall) trucks
Specific flags for all options on the filter panel
```csharp
{ DespawnerRoad,
ExtVehicleType.RoadVehicle },
{ DespawnerParked,
ExtVehicleType.None }, // special case
{ DespawnerServices,
ExtVehicleType.Service |
ExtVehicleType.Emergency },
{ DespawnerTransport,
ExtVehicleType.PublicTransport |
ExtVehicleType.PassengerFerry |
ExtVehicleType.PassengerBlimp |
ExtVehicleType.PassengerPlane |
ExtVehicleType.PassengerShip },
{ DespawnerPassengerTrains,
ExtVehicleType.PassengerTrain },
{ DespawnerCargoTrains,
ExtVehicleType.CargoTrain },
{ DespawnerAircraft,
ExtVehicleType.Plane |
ExtVehicleType.Blimp |
ExtVehicleType.Helicopter },
{ DespawnerShips,
ExtVehicleType.Ship |
ExtVehicleType.Ferry },
```
It's possible that some workshop vehicles have incorrect AIs, but given that there were quite a lot of vehicles from multiple creators, I'm not sure if that's the culprit.
Steps to reproduce
With PR #1341, load a city
In maintenance options, select 'Road vehicles' and click Despawn
Check the city
Repeat, this tile with 'Service vehicles'
Log files
Note: I'd just done a hotload (after testing mentioned above) when these logs were grabbed
Describe the problem
I'm using this code to get the
ExtVehicleType
of aVehicle
:As part of developing/testing PR #1341 I found the following issues (assuming I've not blundered somewhere):
ExtVehicleType.PassengerCar
does not include tourist carsExtVehicleType.Service
does not include things like Garbage (not sure if Vanilla or Sunset Harbor) / Maintenance (Snowfall) trucksSpecific flags for all options on the filter panel
```csharp { DespawnerRoad, ExtVehicleType.RoadVehicle }, { DespawnerParked, ExtVehicleType.None }, // special case { DespawnerServices, ExtVehicleType.Service | ExtVehicleType.Emergency }, { DespawnerTransport, ExtVehicleType.PublicTransport | ExtVehicleType.PassengerFerry | ExtVehicleType.PassengerBlimp | ExtVehicleType.PassengerPlane | ExtVehicleType.PassengerShip }, { DespawnerPassengerTrains, ExtVehicleType.PassengerTrain }, { DespawnerCargoTrains, ExtVehicleType.CargoTrain }, { DespawnerAircraft, ExtVehicleType.Plane | ExtVehicleType.Blimp | ExtVehicleType.Helicopter }, { DespawnerShips, ExtVehicleType.Ship | ExtVehicleType.Ferry }, ```It's possible that some workshop vehicles have incorrect AIs, but given that there were quite a lot of vehicles from multiple creators, I'm not sure if that's the culprit.
Steps to reproduce
Log files
Note: I'd just done a hotload (after testing mentioned above) when these logs were grabbed
TMPE.log
output_log.txt