| 4241 | } |
| 4242 | |
| 4243 | uint16_t Train::GetMaxWeight() const |
| 4244 | { |
| 4245 | uint16_t weight = CargoSpec::Get(this->cargo_type)->WeightOfNUnitsInTrain(this->GetEngine()->DetermineCapacity(this)); |
| 4246 | |
| 4247 | /* Vehicle weight is not added for articulated parts. */ |
| 4248 | if (!this->IsArticulatedPart()) { |
| 4249 | weight += GetVehicleProperty(this, PROP_TRAIN_WEIGHT, RailVehInfo(this->engine_type)->weight); |
| 4250 | } |
| 4251 | |
| 4252 | /* Powered wagons have extra weight added. */ |
| 4253 | if (this->flags.Test(VehicleRailFlag::PoweredWagon)) { |
| 4254 | weight += RailVehInfo(this->gcache.first_engine)->pow_wag_weight; |
| 4255 | } |
| 4256 | |
| 4257 | return weight; |
| 4258 | } |
no test coverage detected