Fix AtmosDeviceSystem debug assert Heisenbug (#29752)

Fix AtmosDeviceSystem debug assertion Heisenbug
This commit is contained in:
Tayrtahn
2024-07-11 02:14:34 -04:00
committed by GitHub
parent 02636386b5
commit e6f55fafb4
2 changed files with 63 additions and 1 deletions

View File

@@ -132,10 +132,19 @@ namespace Content.Server.Atmos.Piping.EntitySystems
var ev = new AtmosDeviceUpdateEvent(_atmosphereSystem.AtmosTime, null, null);
foreach (var device in _joinedDevices)
{
DebugTools.Assert(!HasComp<GridAtmosphereComponent>(Transform(device).GridUid));
var deviceGrid = Transform(device).GridUid;
if (HasComp<GridAtmosphereComponent>(deviceGrid))
{
RejoinAtmosphere(device);
}
RaiseLocalEvent(device, ref ev);
device.Comp.LastProcess = time;
}
}
public bool IsJoinedOffGrid(Entity<AtmosDeviceComponent> device)
{
return _joinedDevices.Contains(device);
}
}
}