Merge remote-tracking branch 'upstream/master' into upstream
# Conflicts: # Content.Server/Body/Components/BloodstreamComponent.cs # Content.Server/Chemistry/EntitySystems/ChemistrySystem.cs # Resources/Prototypes/Entities/Objects/Specific/Medical/hypospray.yml # Resources/Prototypes/Entities/Structures/Machines/lathe.yml # Resources/Textures/Clothing/OuterClothing/Coats/labcoat.rsi/open-inhand-left.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat.rsi/open-inhand-right.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_chem.rsi/open-inhand-left.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_chem.rsi/open-inhand-right.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_gene.rsi/open-inhand-left.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_gene.rsi/open-inhand-right.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_robo.rsi/open-inhand-left.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_robo.rsi/open-inhand-right.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_viro.rsi/open-inhand-left.png # Resources/Textures/Clothing/OuterClothing/Coats/labcoat_viro.rsi/open-inhand-right.png # Resources/Textures/Clothing/OuterClothing/Coats/rndcoat.rsi/open-inhand-left.png # Resources/Textures/Clothing/OuterClothing/Coats/rndcoat.rsi/open-inhand-right.png # Resources/Textures/Clothing/OuterClothing/Hardsuits/evaprisoner.rsi/open-inhand-left.png # Resources/Textures/Clothing/OuterClothing/Hardsuits/evaprisoner.rsi/open-inhand-right.png
This commit is contained in:
@@ -47,17 +47,13 @@ namespace Content.Server.Atmos.Portable
|
||||
|
||||
private void OnDeviceUpdated(EntityUid uid, PortableScrubberComponent component, ref AtmosDeviceUpdateEvent args)
|
||||
{
|
||||
if (!TryComp(uid, out AtmosDeviceComponent? device))
|
||||
return;
|
||||
|
||||
var timeDelta = args.dt;
|
||||
|
||||
if (!component.Enabled)
|
||||
return;
|
||||
|
||||
// If we are on top of a connector port, empty into it.
|
||||
if (TryComp<NodeContainerComponent>(uid, out var nodeContainer)
|
||||
&& _nodeContainer.TryGetNode(nodeContainer, component.PortName, out PortablePipeNode? portableNode)
|
||||
if (_nodeContainer.TryGetNode(uid, component.PortName, out PortablePipeNode? portableNode)
|
||||
&& portableNode.ConnectionsEnabled)
|
||||
{
|
||||
_atmosphereSystem.React(component.Air, portableNode);
|
||||
@@ -71,13 +67,11 @@ namespace Content.Server.Atmos.Portable
|
||||
return;
|
||||
}
|
||||
|
||||
var xform = Transform(uid);
|
||||
|
||||
if (xform.GridUid == null)
|
||||
if (args.Grid is not {} grid)
|
||||
return;
|
||||
|
||||
var position = _transformSystem.GetGridTilePositionOrDefault((uid,xform));
|
||||
var environment = _atmosphereSystem.GetTileMixture(xform.GridUid, xform.MapUid, position, true);
|
||||
var position = _transformSystem.GetGridTilePositionOrDefault(uid);
|
||||
var environment = _atmosphereSystem.GetTileMixture(grid, args.Map, position, true);
|
||||
|
||||
var running = Scrub(timeDelta, component, environment);
|
||||
|
||||
@@ -85,8 +79,9 @@ namespace Content.Server.Atmos.Portable
|
||||
// We scrub once to see if we can and set the animation
|
||||
if (!running)
|
||||
return;
|
||||
|
||||
// widenet
|
||||
var enumerator = _atmosphereSystem.GetAdjacentTileMixtures(xform.GridUid.Value, position, false, true);
|
||||
var enumerator = _atmosphereSystem.GetAdjacentTileMixtures(grid, position, false, true);
|
||||
while (enumerator.MoveNext(out var adjacent))
|
||||
{
|
||||
Scrub(timeDelta, component, adjacent);
|
||||
@@ -98,10 +93,7 @@ namespace Content.Server.Atmos.Portable
|
||||
/// </summary>
|
||||
private void OnAnchorChanged(EntityUid uid, PortableScrubberComponent component, ref AnchorStateChangedEvent args)
|
||||
{
|
||||
if (!TryComp(uid, out NodeContainerComponent? nodeContainer))
|
||||
return;
|
||||
|
||||
if (!_nodeContainer.TryGetNode(nodeContainer, component.PortName, out PipeNode? portableNode))
|
||||
if (!_nodeContainer.TryGetNode(uid, component.PortName, out PipeNode? portableNode))
|
||||
return;
|
||||
|
||||
portableNode.ConnectionsEnabled = (args.Anchored && _gasPortableSystem.FindGasPortIn(Transform(uid).GridUid, Transform(uid).Coordinates, out _));
|
||||
@@ -159,14 +151,10 @@ namespace Content.Server.Atmos.Portable
|
||||
/// </summary>
|
||||
private void OnScrubberAnalyzed(EntityUid uid, PortableScrubberComponent component, GasAnalyzerScanEvent args)
|
||||
{
|
||||
var gasMixDict = new Dictionary<string, GasMixture?> { { Name(uid), component.Air } };
|
||||
args.GasMixtures ??= new Dictionary<string, GasMixture?> { { Name(uid), component.Air } };
|
||||
// If it's connected to a port, include the port side
|
||||
if (TryComp(uid, out NodeContainerComponent? nodeContainer))
|
||||
{
|
||||
if (_nodeContainer.TryGetNode(nodeContainer, component.PortName, out PipeNode? port))
|
||||
gasMixDict.Add(component.PortName, port.Air);
|
||||
}
|
||||
args.GasMixtures = gasMixDict;
|
||||
if (_nodeContainer.TryGetNode(uid, component.PortName, out PipeNode? port))
|
||||
args.GasMixtures.Add(component.PortName, port.Air);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -71,7 +71,7 @@ public sealed class SpaceHeaterSystem : EntitySystem
|
||||
// If in automatic temperature mode, check if we need to adjust the heat exchange direction
|
||||
if (spaceHeater.Mode == SpaceHeaterMode.Auto)
|
||||
{
|
||||
var environment = _atmosphereSystem.GetContainingMixture(uid);
|
||||
var environment = _atmosphereSystem.GetContainingMixture(uid, args.Grid, args.Map);
|
||||
if (environment == null)
|
||||
return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user