Take cargo refit into account in build vehicle window capacity sort modes

This commit is contained in:
Jonathan G Rennison
2024-05-05 12:55:33 +01:00
parent 1e5c96ef87
commit f993e30850
7 changed files with 112 additions and 28 deletions

View File

@@ -159,11 +159,12 @@ void ShowEnginePreviewWindow(EngineID engine)
/**
* Get the capacity of an engine with articulated parts.
* @param engine The engine to get the capacity of.
* @param attempt_refit Attempt to get capacity when refitting to this cargo.
* @return The capacity.
*/
uint GetTotalCapacityOfArticulatedParts(EngineID engine)
uint GetTotalCapacityOfArticulatedParts(EngineID engine, CargoID attempt_refit)
{
CargoArray cap = GetCapacityOfArticulatedParts(engine);
CargoArray cap = GetCapacityOfArticulatedParts(engine, attempt_refit);
return cap.GetSum<uint>();
}