Cleanup: Remove some unused functions. (#11429)

These were picked up with cppcheck.
This commit is contained in:
Peter Nelson
2023-11-03 21:21:00 +00:00
committed by GitHub
parent 4c58df75fd
commit 7d4a91ef9e
15 changed files with 0 additions and 157 deletions

View File

@@ -2353,32 +2353,6 @@ void Vehicle::HandleLoading(bool mode)
this->IncrementImplicitOrderIndex();
}
/**
* Get a map of cargoes and free capacities in the consist.
* @param capacities Map to be filled with cargoes and capacities.
*/
void Vehicle::GetConsistFreeCapacities(std::map<CargoID, uint> &capacities) const
{
for (const Vehicle *v = this; v != nullptr; v = v->Next()) {
if (v->cargo_cap == 0) continue;
auto pair = capacities.find(v->cargo_type);
if (pair == capacities.end()) {
capacities[v->cargo_type] = v->cargo_cap - v->cargo.StoredCount();
} else {
pair->second += v->cargo_cap - v->cargo.StoredCount();
}
}
}
uint Vehicle::GetConsistTotalCapacity() const
{
uint result = 0;
for (const Vehicle *v = this; v != nullptr; v = v->Next()) {
result += v->cargo_cap;
}
return result;
}
/**
* Send this vehicle to the depot using the given command(s).
* @param flags the command flags (like execute and such).