Remove 700 usages of Component.Owner (#21100)
This commit is contained in:
@@ -7,7 +7,6 @@ using Content.Server.NodeContainer.Nodes;
|
||||
using Content.Shared.Atmos.Piping;
|
||||
using Content.Shared.Audio;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
|
||||
namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
{
|
||||
@@ -40,7 +39,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
|| !_nodeContainer.TryGetNode(nodeContainer, comp.ControlName, out PipeNode? controlNode)
|
||||
|| !_nodeContainer.TryGetNode(nodeContainer, comp.OutletName, out PipeNode? outletNode))
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(comp.Owner, false);
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
comp.Enabled = false;
|
||||
return;
|
||||
}
|
||||
@@ -68,14 +67,14 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
UpdateAppearance(uid, comp);
|
||||
|
||||
// We multiply the transfer rate in L/s by the seconds passed since the last process to get the liters.
|
||||
var transferVolume = (float)(transferRate * args.dt);
|
||||
var transferVolume = transferRate * args.dt;
|
||||
if (transferVolume <= 0)
|
||||
{
|
||||
_ambientSoundSystem.SetAmbience(comp.Owner, false);
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
return;
|
||||
}
|
||||
|
||||
_ambientSoundSystem.SetAmbience(comp.Owner, true);
|
||||
_ambientSoundSystem.SetAmbience(uid, true);
|
||||
var removed = inletNode.Air.RemoveVolume(transferVolume);
|
||||
_atmosphereSystem.Merge(outletNode.Air, removed);
|
||||
}
|
||||
@@ -84,7 +83,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems
|
||||
{
|
||||
comp.Enabled = false;
|
||||
UpdateAppearance(uid, comp);
|
||||
_ambientSoundSystem.SetAmbience(comp.Owner, false);
|
||||
_ambientSoundSystem.SetAmbience(uid, false);
|
||||
}
|
||||
|
||||
private void UpdateAppearance(EntityUid uid, PressureControlledValveComponent? comp = null, AppearanceComponent? appearance = null)
|
||||
|
||||
Reference in New Issue
Block a user