MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getNumUnitsForCargo

Function getNumUnitsForCargo

src/OpenLoco/src/Vehicles/VehicleBody.cpp:1420–1425  ·  view source on GitHub ↗

0x0042F6B6 TODO: move this?

Source from the content-addressed store, hash-verified

1418 // 0x0042F6B6
1419 // TODO: move this?
1420 uint32_t getNumUnitsForCargo(uint32_t maxPrimaryCargo, uint8_t primaryCargoId, uint8_t newCargoId)
1421 {
1422 auto cargoObjA = ObjectManager::get<CargoObject>(primaryCargoId);
1423 auto cargoObjB = ObjectManager::get<CargoObject>(newCargoId);
1424 return (cargoObjA->unitSize * maxPrimaryCargo) / cargoObjB->unitSize;
1425 }
1426}

Callers 3

estimateThoughtRevenueFunction · 0.85
onRefitButtonFunction · 0.85
vehicleRefitFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected