Codechange: replace INVALID_X with XID::Invalid() for PoolIDs
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user