Skip to content

Instantly share code, notes, and snippets.

@SamuXarick
Created March 6, 2023 16:27
Show Gist options
  • Save SamuXarick/d2f46bcf3fd6f95597d4eb0abee3f527 to your computer and use it in GitHub Desktop.
Save SamuXarick/d2f46bcf3fd6f95597d4eb0abee3f527 to your computer and use it in GitHub Desktop.
ScriptVehicleList_DefaultGroup::ScriptVehicleList_DefaultGroup(ScriptVehicle::VehicleType vehicle_type)
{
if (vehicle_type < ScriptVehicle::VT_RAIL || vehicle_type > ScriptVehicle::VT_AIR) return;
// for (const Vehicle *v : Vehicle::Iterate()) {
// if (v->owner == ScriptObject::GetCompany() && v->IsPrimaryVehicle()) {
// if (v->type == (::VehicleType)vehicle_type && v->group_id == ScriptGroup::GROUP_DEFAULT) this->AddItem(v->index);
// }
// }
GroupStatistics stats = Company::Get(ScriptObject::GetCompany())->group_default[(::VehicleType)vehicle_type];
for (auto vehicle_id : stats.vehicle_list) {
this->AddItem(vehicle_id);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment