Remove 700 usages of Component.Owner (#21100)

This commit is contained in:
DrSmugleaf
2023-10-19 12:34:31 -07:00
committed by GitHub
parent 5825ffb95c
commit f560f88eb5
261 changed files with 2291 additions and 2036 deletions

View File

@@ -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)