refactor(backend): simplify cargo kind loading

This commit is contained in:
2026-03-27 15:18:42 -04:00
parent e8fb033a01
commit 3237735b08
11 changed files with 35 additions and 82 deletions

View File

@@ -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;
}