Cargo shuttle changes (#14363)

This commit is contained in:
metalgearsloth
2023-03-23 16:10:49 +11:00
committed by GitHub
parent 7f4bb7fe8a
commit 569f30b721
26 changed files with 523 additions and 628 deletions

View File

@@ -263,20 +263,25 @@ namespace Content.Server.Cargo.Systems
private void UpdateOrders(StationCargoOrderDatabaseComponent component)
{
// Order added so all consoles need updating.
foreach (var comp in EntityQuery<CargoOrderConsoleComponent>(true))
var orderQuery = AllEntityQuery<CargoOrderConsoleComponent>();
while (orderQuery.MoveNext(out var uid, out var comp))
{
var station = _station.GetOwningStation(component.Owner);
if (station != component.Owner) continue;
var station = _station.GetOwningStation(uid);
if (station != component.Owner)
continue;
UpdateOrderState(comp, station);
}
foreach (var comp in EntityQuery<CargoShuttleConsoleComponent>(true))
var consoleQuery = AllEntityQuery<CargoShuttleConsoleComponent>();
while (consoleQuery.MoveNext(out var uid, out var comp))
{
var station = _station.GetOwningStation(component.Owner);
if (station != component.Owner) continue;
var station = _station.GetOwningStation(uid);
if (station != component.Owner)
continue;
UpdateShuttleState(comp, station);
UpdateShuttleState(uid, comp, station);
}
}