refactor(backend): simplify cargo kind loading
This commit is contained in:
@@ -408,7 +408,7 @@ internal sealed class StationSimulationService
|
||||
return false;
|
||||
}
|
||||
|
||||
var storageKind = itemDefinition.CargoStorageKind;
|
||||
var storageKind = itemDefinition.CargoKind;
|
||||
if (storageKind is null)
|
||||
{
|
||||
return false;
|
||||
@@ -426,7 +426,7 @@ internal sealed class StationSimulationService
|
||||
}
|
||||
|
||||
var used = station.Inventory
|
||||
.Where(entry => world.ItemDefinitions.TryGetValue(entry.Key, out var definition) && definition.CargoStorageKind == storageKind)
|
||||
.Where(entry => world.ItemDefinitions.TryGetValue(entry.Key, out var definition) && definition.CargoKind == storageKind)
|
||||
.Sum(entry => entry.Value);
|
||||
return used + amount <= capacity + 0.001f;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user