Codechange: replace INVALID_X with XID::Invalid() for PoolIDs

This commit is contained in:
Rubidium
2025-02-16 19:29:53 +01:00
committed by rubidium42
parent d13b0e0813
commit fd4adc55e3
157 changed files with 744 additions and 772 deletions

View File

@@ -134,7 +134,7 @@
while (dest_wagon-- > 0) w = w->GetNextUnit();
}
return ScriptObject::Command<CMD_MOVE_RAIL_VEHICLE>::Do(v->index, w == nullptr ? ::INVALID_VEHICLE : w->index, move_attached_wagons);
return ScriptObject::Command<CMD_MOVE_RAIL_VEHICLE>::Do(v->index, w == nullptr ? VehicleID::Invalid() : w->index, move_attached_wagons);
}
/* static */ bool ScriptVehicle::MoveWagon(VehicleID source_vehicle_id, SQInteger source_wagon, SQInteger dest_vehicle_id, SQInteger dest_wagon)
@@ -275,15 +275,15 @@
/* static */ EngineID ScriptVehicle::GetEngineType(VehicleID vehicle_id)
{
if (!IsValidVehicle(vehicle_id)) return INVALID_ENGINE;
if (!IsValidVehicle(vehicle_id)) return ::EngineID::Invalid();
return ::Vehicle::Get(vehicle_id)->engine_type;
}
/* static */ EngineID ScriptVehicle::GetWagonEngineType(VehicleID vehicle_id, SQInteger wagon)
{
if (!IsValidVehicle(vehicle_id)) return INVALID_ENGINE;
if (wagon >= GetNumWagons(vehicle_id)) return INVALID_ENGINE;
if (!IsValidVehicle(vehicle_id)) return ::EngineID::Invalid();
if (wagon >= GetNumWagons(vehicle_id)) return ::EngineID::Invalid();
const Vehicle *v = ::Vehicle::Get(vehicle_id);
if (v->type == VEH_TRAIN) {