Reduce atmos system resolves (#6465)

This commit is contained in:
Leon Friedrich
2022-02-05 23:57:26 +13:00
committed by GitHub
parent df1162e9f6
commit 32ada7de7a
9 changed files with 20 additions and 16 deletions

View File

@@ -1,4 +1,5 @@
using System;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Binary.Components;
using Content.Server.Atmos.Piping.Components;
using Content.Server.NodeContainer;
@@ -6,12 +7,15 @@ using Content.Server.NodeContainer.Nodes;
using Content.Shared.Atmos;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{
[UsedImplicitly]
public class GasPassiveGateSystem : EntitySystem
{
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
public override void Initialize()
{
base.Initialize();
@@ -46,7 +50,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
var transferMoles = pressureDelta * outlet.Air.Volume / (inlet.Air.Temperature * Atmospherics.R);
// Actually transfer the gas.
outlet.AssumeAir(inlet.Air.Remove(transferMoles));
_atmosphereSystem.Merge(outlet.Air, inlet.Air.Remove(transferMoles));
}
}
}

View File

@@ -1,5 +1,6 @@
using System;
using Content.Server.Administration.Logs;
using Content.Server.Atmos.EntitySystems;
using Content.Server.Atmos.Piping.Binary.Components;
using Content.Server.Atmos.Piping.Components;
using Content.Server.NodeContainer;
@@ -25,6 +26,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
{
[Dependency] private UserInterfaceSystem _userInterfaceSystem = default!;
[Dependency] private AdminLogSystem _adminLogSystem = default!;
[Dependency] private readonly AtmosphereSystem _atmosphereSystem = default!;
public override void Initialize()
{
@@ -81,7 +83,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
var transferMoles = pressureDelta * outlet.Air.Volume / inlet.Air.Temperature * Atmospherics.R;
var removed = inlet.Air.Remove(transferMoles);
outlet.AssumeAir(removed);
_atmosphereSystem.Merge(outlet.Air, removed);
}
}

View File

@@ -95,7 +95,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems
}
}
outlet.AssumeAir(removed);
_atmosphereSystem.Merge(outlet.Air, removed);
}
private void OnPumpInteractHand(EntityUid uid, GasVolumePumpComponent component, InteractHandEvent args)