From ca98e78c6911b260ba185e1b1e29e5ec25c35a73 Mon Sep 17 00:00:00 2001 From: cirdan Date: Sat, 5 Mar 2016 15:24:32 +0100 Subject: [PATCH] Remove unused Vehicle capacity methods Remove unused methods Vehicle::GetConsistFreeCapacities and Vehicle::GetConsistTotalCapacity. (cherry picked from commit d97442878f9856c253a3bf976b6a3e114faebefe) --- src/vehicle.cpp | 28 ---------------------------- src/vehicle_base.h | 4 ---- 2 files changed, 32 deletions(-) diff --git a/src/vehicle.cpp b/src/vehicle.cpp index f5ba0d297b..ca4b6af2e1 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -2663,34 +2663,6 @@ void Vehicle::HandleWaiting(bool stop_waiting) } } -/** - * Get a map of cargoes and free capacities in the consist. - * @param capacities Map to be filled with cargoes and capacities. - */ -void Vehicle::GetConsistFreeCapacities(SmallMap &capacities) const -{ - for (const Vehicle *v = this; v != NULL; v = v->Next()) { - if (v->cargo_cap == 0) continue; - SmallPair *pair = capacities.Find(v->cargo_type); - if (pair == capacities.End()) { - pair = capacities.Append(); - pair->first = v->cargo_type; - pair->second = 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 != NULL; 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). diff --git a/src/vehicle_base.h b/src/vehicle_base.h index 6c5264a054..d7282a46c1 100644 --- a/src/vehicle_base.h +++ b/src/vehicle_base.h @@ -318,10 +318,6 @@ public: void HandleWaiting(bool stop_waiting = false); - void GetConsistFreeCapacities(SmallMap &capacities) const; - - uint GetConsistTotalCapacity() const; - /** * Marks the vehicles to be redrawn and updates cached variables *