MCPcopy Create free account
hub / github.com/OpenTTD/OpenTTD / GetDisplayMaxWeight

Method GetDisplayMaxWeight

src/vehicle.cpp:3232–3241  ·  view source on GitHub ↗

* Calculates the maximum weight of the ground vehicle when loaded. * @return Weight in tonnes */

Source from the content-addressed store, hash-verified

3230 * @return Weight in tonnes
3231 */
3232uint32_t Vehicle::GetDisplayMaxWeight() const
3233{
3234 uint32_t max_weight = 0;
3235
3236 for (const Vehicle *u = this; u != nullptr; u = u->Next()) {
3237 max_weight += u->GetMaxWeight();
3238 }
3239
3240 return max_weight;
3241}
3242
3243/**
3244 * Calculates the minimum power-to-weight ratio using the maximum weight of the ground vehicle

Callers

nothing calls this directly

Calls 2

NextMethod · 0.45
GetMaxWeightMethod · 0.45

Tested by

no test coverage detected