diff --git a/Content.Client/Atmos/Visualizers/AtmosPlaqueVisualizer.cs b/Content.Client/Atmos/Visualizers/AtmosPlaqueVisualizer.cs index 1a219d87b2..5a5b1f30cc 100644 --- a/Content.Client/Atmos/Visualizers/AtmosPlaqueVisualizer.cs +++ b/Content.Client/Atmos/Visualizers/AtmosPlaqueVisualizer.cs @@ -24,7 +24,7 @@ namespace Content.Client.Atmos.Visualizers { base.OnChangeData(component); - if (!IoCManager.Resolve().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite)) + if (!IoCManager.Resolve().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite)) { return; } diff --git a/Content.Client/Atmos/Visualizers/PipeColorVisualizer.cs b/Content.Client/Atmos/Visualizers/PipeColorVisualizer.cs index f364401514..93a0a32889 100644 --- a/Content.Client/Atmos/Visualizers/PipeColorVisualizer.cs +++ b/Content.Client/Atmos/Visualizers/PipeColorVisualizer.cs @@ -14,7 +14,7 @@ namespace Content.Client.Atmos.Visualizers { base.OnChangeData(component); - if (!IoCManager.Resolve().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite)) + if (!IoCManager.Resolve().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite)) return; if (component.TryGetData(PipeColorVisuals.Color, out Color color)) diff --git a/Content.Client/Instruments/InstrumentSystem.cs b/Content.Client/Instruments/InstrumentSystem.cs index 51419df143..c107c0542b 100644 --- a/Content.Client/Instruments/InstrumentSystem.cs +++ b/Content.Client/Instruments/InstrumentSystem.cs @@ -319,7 +319,7 @@ namespace Content.Client.Instruments foreach (var instrument in EntityManager.EntityQuery(true)) { if (instrument.DirtyRenderer && instrument.Renderer != null) - UpdateRenderer(instrument.OwnerUid, instrument); + UpdateRenderer(((IComponent) instrument).Owner, instrument); if (!instrument.IsMidiOpen && !instrument.IsInputOpen) continue; @@ -366,7 +366,7 @@ namespace Content.Client.Instruments if (eventCount == 0) continue; - RaiseNetworkEvent(new InstrumentMidiEventEvent(instrument.OwnerUid, events)); + RaiseNetworkEvent(new InstrumentMidiEventEvent(((IComponent) instrument).Owner, events)); instrument.SentWithinASec += eventCount; diff --git a/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs b/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs index 5a3842bb5e..2c3484953d 100644 --- a/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs +++ b/Content.Client/Instruments/UI/InstrumentMenu.xaml.cs @@ -104,7 +104,7 @@ namespace Content.Client.Instruments.UI await Task.WhenAll(Timer.Delay(100), file.CopyToAsync(memStream)); if (_owner.Instrument is not {} instrument - || !EntitySystem.Get().OpenMidi(instrument.OwnerUid, memStream.GetBuffer().AsSpan(0, (int) memStream.Length), instrument)) + || !EntitySystem.Get().OpenMidi(((IComponent) instrument).Owner, memStream.GetBuffer().AsSpan(0, (int) memStream.Length), instrument)) return; MidiPlaybackSetButtonsDisabled(false); @@ -123,10 +123,10 @@ namespace Content.Client.Instruments.UI MidiStopButtonOnPressed(null); if(_owner.Instrument is {} instrument) - instrumentSystem.OpenInput(instrument.OwnerUid, instrument); + instrumentSystem.OpenInput(((IComponent) instrument).Owner, instrument); } else if(_owner.Instrument is {} instrument) - instrumentSystem.CloseInput(instrument.OwnerUid, false, instrument); + instrumentSystem.CloseInput(((IComponent) instrument).Owner, false, instrument); } private bool PlayCheck() @@ -162,7 +162,7 @@ namespace Content.Client.Instruments.UI if (_owner.Instrument is not { } instrument) return; - EntitySystem.Get().CloseMidi(instrument.OwnerUid, false, instrument); + EntitySystem.Get().CloseMidi(((IComponent) instrument).Owner, false, instrument); } private void MidiLoopButtonOnOnToggled(ButtonToggledEventArgs obj) @@ -179,14 +179,14 @@ namespace Content.Client.Instruments.UI // Do not seek while still grabbing. if (PlaybackSlider.Grabbed || _owner.Instrument is not {} instrument) return; - EntitySystem.Get().SetPlayerTick(instrument.OwnerUid, (int)Math.Ceiling(PlaybackSlider.Value), instrument); + EntitySystem.Get().SetPlayerTick(((IComponent) instrument).Owner, (int)Math.Ceiling(PlaybackSlider.Value), instrument); } private void PlaybackSliderKeyUp(GUIBoundKeyEventArgs args) { if (args.Function != EngineKeyFunctions.UIClick || _owner.Instrument is not {} instrument) return; - EntitySystem.Get().SetPlayerTick(instrument.OwnerUid, (int)Math.Ceiling(PlaybackSlider.Value), instrument); + EntitySystem.Get().SetPlayerTick(((IComponent) instrument).Owner, (int)Math.Ceiling(PlaybackSlider.Value), instrument); } protected override void FrameUpdate(FrameEventArgs args) diff --git a/Content.Client/Inventory/ClientInventoryComponent.cs b/Content.Client/Inventory/ClientInventoryComponent.cs index 0cec189f5c..7b686da558 100644 --- a/Content.Client/Inventory/ClientInventoryComponent.cs +++ b/Content.Client/Inventory/ClientInventoryComponent.cs @@ -123,7 +123,7 @@ namespace Content.Client.Inventory } } - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); } private void _setSlot(Slots slot, IEntity entity) diff --git a/Content.Client/Mining/AsteroidRockVisualizer.cs b/Content.Client/Mining/AsteroidRockVisualizer.cs index ac3afa5cc1..9d30ee6b99 100644 --- a/Content.Client/Mining/AsteroidRockVisualizer.cs +++ b/Content.Client/Mining/AsteroidRockVisualizer.cs @@ -24,7 +24,7 @@ namespace Content.Client.Mining { base.OnChangeData(component); - if (!IoCManager.Resolve().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite)) + if (!IoCManager.Resolve().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite)) { return; } diff --git a/Content.Client/Nutrition/Components/HungerComponent.cs b/Content.Client/Nutrition/Components/HungerComponent.cs index 3c24528499..e865a6ae12 100644 --- a/Content.Client/Nutrition/Components/HungerComponent.cs +++ b/Content.Client/Nutrition/Components/HungerComponent.cs @@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components _currentHungerThreshold = hunger.CurrentThreshold; - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); } } } diff --git a/Content.Client/Nutrition/Components/ThirstComponent.cs b/Content.Client/Nutrition/Components/ThirstComponent.cs index 0b1700dc3c..1493f94024 100644 --- a/Content.Client/Nutrition/Components/ThirstComponent.cs +++ b/Content.Client/Nutrition/Components/ThirstComponent.cs @@ -22,7 +22,7 @@ namespace Content.Client.Nutrition.Components _currentThirstThreshold = thirst.CurrentThreshold; - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); } } } diff --git a/Content.Client/Singularity/Visualizers/SingularityVisualizer.cs b/Content.Client/Singularity/Visualizers/SingularityVisualizer.cs index 99ed733c8b..3af27ff263 100644 --- a/Content.Client/Singularity/Visualizers/SingularityVisualizer.cs +++ b/Content.Client/Singularity/Visualizers/SingularityVisualizer.cs @@ -25,7 +25,7 @@ namespace Content.Client.Singularity.Visualizers { base.OnChangeData(component); - if (!IoCManager.Resolve().TryGetComponent(component.OwnerUid, out SpriteComponent? sprite)) + if (!IoCManager.Resolve().TryGetComponent(((IComponent) component).Owner, out SpriteComponent? sprite)) { return; } diff --git a/Content.IntegrationTests/Tests/Body/LungTest.cs b/Content.IntegrationTests/Tests/Body/LungTest.cs index 597d76127c..6b9e2b8fe5 100644 --- a/Content.IntegrationTests/Tests/Body/LungTest.cs +++ b/Content.IntegrationTests/Tests/Body/LungTest.cs @@ -82,7 +82,7 @@ namespace Content.IntegrationTests.Tests.Body gas.AdjustMoles(Gas.Nitrogen, originalNitrogen); var (lung, _) = lungs[0]; - lungSys.TakeGasFrom(lung.OwnerUid, 1, gas, lung); + lungSys.TakeGasFrom(((IComponent) lung).Owner, 1, gas, lung); var lungOxygen = originalOxygen * breathedPercentage; var lungNitrogen = originalNitrogen * breathedPercentage; @@ -103,7 +103,7 @@ namespace Content.IntegrationTests.Tests.Body Assert.Zero(lungOxygenBeforeExhale); Assert.Zero(lungNitrogenBeforeExhale); - lungSys.PushGasTo(lung.OwnerUid, gas, lung); + lungSys.PushGasTo(((IComponent) lung).Owner, gas, lung); var lungOxygenAfterExhale = lung.Air.GetMoles(Gas.Oxygen); var exhaledOxygen = Math.Abs(lungOxygenBeforeExhale - lungOxygenAfterExhale); diff --git a/Content.Server/Access/Components/IdCardConsoleComponent.cs b/Content.Server/Access/Components/IdCardConsoleComponent.cs index 9c93b7e454..5c57f8acf1 100644 --- a/Content.Server/Access/Components/IdCardConsoleComponent.cs +++ b/Content.Server/Access/Components/IdCardConsoleComponent.cs @@ -110,9 +110,9 @@ namespace Content.Server.Access.Components private void HandleIdButton(IEntity user, ItemSlot slot) { if (slot.HasItem) - EntitySystem.Get().TryEjectToHands(OwnerUid, slot, user); + EntitySystem.Get().TryEjectToHands(((IComponent) this).Owner, slot, user); else - EntitySystem.Get().TryInsertFromHand(OwnerUid, slot, user); + EntitySystem.Get().TryInsertFromHand(((IComponent) this).Owner, slot, user); } public void UpdateUserInterface() diff --git a/Content.Server/Administration/Logs/AdminLogSystem.Json.cs b/Content.Server/Administration/Logs/AdminLogSystem.Json.cs index 79ab73257e..1878c466ed 100644 --- a/Content.Server/Administration/Logs/AdminLogSystem.Json.cs +++ b/Content.Server/Administration/Logs/AdminLogSystem.Json.cs @@ -59,7 +59,7 @@ public partial class AdminLogSystem EntityUid id => id, IEntity entity => entity, IPlayerSession {AttachedEntityUid: { }} session => session.AttachedEntityUid.Value, - IComponent component => component.OwnerUid, + IComponent component => component.Owner, _ => null }; diff --git a/Content.Server/Animals/Systems/UdderSystem.cs b/Content.Server/Animals/Systems/UdderSystem.cs index 9eb223bca8..91d00f8ed3 100644 --- a/Content.Server/Animals/Systems/UdderSystem.cs +++ b/Content.Server/Animals/Systems/UdderSystem.cs @@ -51,11 +51,11 @@ namespace Content.Server.Animals.Systems continue; } - if (!_solutionContainerSystem.TryGetSolution(udder.OwnerUid, udder.TargetSolutionName, out var solution)) + if (!_solutionContainerSystem.TryGetSolution(((IComponent) udder).Owner, udder.TargetSolutionName, out var solution)) continue; //TODO: toxins from bloodstream !? - _solutionContainerSystem.TryAddReagent(udder.OwnerUid, solution, udder.ReagentId, udder.QuantityPerUpdate, out var accepted); + _solutionContainerSystem.TryAddReagent(((IComponent) udder).Owner, solution, udder.ReagentId, udder.QuantityPerUpdate, out var accepted); udder.AccumulatedFrameTime = 0; } } diff --git a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs index 879351472b..1c5f856579 100644 --- a/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs +++ b/Content.Server/Arcade/Components/BlockGameArcadeComponent.cs @@ -131,7 +131,7 @@ namespace Content.Server.Arcade.Components if (obj.Session != _player) break; // TODO: Should this check if the Owner can interact...? - if (!EntitySystem.Get().CanInteract(OwnerUid)) + if (!EntitySystem.Get().CanInteract(((IComponent) this).Owner)) { DeactivePlayer(obj.Session); break; diff --git a/Content.Server/Atmos/Components/GasTankComponent.cs b/Content.Server/Atmos/Components/GasTankComponent.cs index 34325acfa9..9074587c70 100644 --- a/Content.Server/Atmos/Components/GasTankComponent.cs +++ b/Content.Server/Atmos/Components/GasTankComponent.cs @@ -269,7 +269,7 @@ namespace Content.Server.Atmos.Components range = MaxExplosionRange; } - EntitySystem.Get().SpawnExplosion(OwnerUid, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1); + EntitySystem.Get().SpawnExplosion(((IComponent) this).Owner, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1); IoCManager.Resolve().QueueDeleteEntity((EntityUid) Owner); return; diff --git a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs index e653297587..8765ec1fcd 100644 --- a/Content.Server/Atmos/EntitySystems/AirtightSystem.cs +++ b/Content.Server/Atmos/EntitySystems/AirtightSystem.cs @@ -79,7 +79,7 @@ namespace Content.Server.Atmos.EntitySystems { airtight.AirBlocked = airblocked; UpdatePosition(airtight); - RaiseLocalEvent(airtight.OwnerUid, new AirtightChanged(airtight)); + RaiseLocalEvent(((IComponent) airtight).Owner, new AirtightChanged(airtight)); } public void UpdatePosition(AirtightComponent airtight) diff --git a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs index 40abc9739c..b6290c5d87 100644 --- a/Content.Server/Atmos/EntitySystems/FlammableSystem.cs +++ b/Content.Server/Atmos/EntitySystems/FlammableSystem.cs @@ -201,9 +201,9 @@ namespace Content.Server.Atmos.EntitySystems var fireStackDelta = fireStackMod - flammable.FireStacks; if (fireStackDelta > 0) { - AdjustFireStacks(flammable.OwnerUid, fireStackDelta, flammable); + AdjustFireStacks(((IComponent) flammable).Owner, fireStackDelta, flammable); } - Ignite(flammable.OwnerUid, flammable); + Ignite(((IComponent) flammable).Owner, flammable); } _fireEvents.Clear(); diff --git a/Content.Server/Body/Systems/BodySystem.cs b/Content.Server/Body/Systems/BodySystem.cs index 11b79789dc..13d7ae15a9 100644 --- a/Content.Server/Body/Systems/BodySystem.cs +++ b/Content.Server/Body/Systems/BodySystem.cs @@ -56,7 +56,7 @@ namespace Content.Server.Body.Systems foreach (var (part, _) in body.Parts) foreach (var mechanism in part.Mechanisms) { - if (EntityManager.TryGetComponent(mechanism.OwnerUid, out var comp)) + if (EntityManager.TryGetComponent(((IComponent) mechanism).Owner, out var comp)) yield return (comp, mechanism); } } diff --git a/Content.Server/Body/Systems/BrainSystem.cs b/Content.Server/Body/Systems/BrainSystem.cs index 6d842eaf3e..4669f3ee6f 100644 --- a/Content.Server/Body/Systems/BrainSystem.cs +++ b/Content.Server/Body/Systems/BrainSystem.cs @@ -14,12 +14,12 @@ namespace Content.Server.Body.Systems { base.Initialize(); - SubscribeLocalEvent((uid, component, args) => HandleMind(args.Body.OwnerUid, uid)); - SubscribeLocalEvent((uid, component, args) => HandleMind(args.Part.OwnerUid, uid)); - SubscribeLocalEvent((uid, component, args) => HandleMind(args.Body.OwnerUid, uid)); + SubscribeLocalEvent((uid, component, args) => HandleMind(((IComponent) args.Body).Owner, uid)); + SubscribeLocalEvent((uid, component, args) => HandleMind(((IComponent) args.Part).Owner, uid)); + SubscribeLocalEvent((uid, component, args) => HandleMind(((IComponent) args.Body).Owner, uid)); SubscribeLocalEvent(OnRemovedFromBody); - SubscribeLocalEvent((uid, component, args) => HandleMind(uid, args.Old.OwnerUid)); - SubscribeLocalEvent((uid, component, args) => HandleMind(args.OldBody.OwnerUid, uid)); + SubscribeLocalEvent((uid, component, args) => HandleMind(uid, ((IComponent) args.Old).Owner)); + SubscribeLocalEvent((uid, component, args) => HandleMind(((IComponent) args.OldBody).Owner, uid)); } private void OnRemovedFromBody(EntityUid uid, BrainComponent component, RemovedFromBodyEvent args) @@ -28,7 +28,7 @@ namespace Content.Server.Body.Systems if (!EntityManager.TryGetComponent(uid, out MechanismComponent mech)) return; - HandleMind(mech.Part!.OwnerUid, args.Old.OwnerUid); + HandleMind(((IComponent) mech.Part!).Owner, ((IComponent) args.Old).Owner); } private void HandleMind(EntityUid newEntity, EntityUid oldEntity) diff --git a/Content.Server/Body/Systems/LungSystem.cs b/Content.Server/Body/Systems/LungSystem.cs index 51fc34d0b4..17d07dd54d 100644 --- a/Content.Server/Body/Systems/LungSystem.cs +++ b/Content.Server/Body/Systems/LungSystem.cs @@ -57,7 +57,7 @@ public class LungSystem : EntitySystem if (!Resolve(uid, ref lung, ref mech)) return; - if (mech.Body != null && EntityManager.TryGetComponent(mech.Body.OwnerUid, out MobStateComponent? mobState) && mobState.IsCritical()) + if (mech.Body != null && EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out MobStateComponent? mobState) && mobState.IsCritical()) { return; } @@ -111,7 +111,7 @@ public class LungSystem : EntitySystem // TODO Jesus Christ make this event based. if (mech.Body != null && - EntityManager.TryGetComponent(mech.Body.OwnerUid, out InternalsComponent? internals) && + EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out InternalsComponent? internals) && internals.BreathToolEntity != null && internals.GasTankEntity != null && IoCManager.Resolve().TryGetComponent(internals.BreathToolEntity, out BreathToolComponent? breathTool) && @@ -148,7 +148,7 @@ public class LungSystem : EntitySystem if (mech.Body == null) return; - if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream)) + if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream)) return; var to = bloodstream.Air; @@ -189,10 +189,10 @@ public class LungSystem : EntitySystem if (mech.Body == null) return; - if (!EntityManager.TryGetComponent(mech.Body.OwnerUid, out BloodstreamComponent? bloodstream)) + if (!EntityManager.TryGetComponent(((IComponent) mech.Body).Owner, out BloodstreamComponent? bloodstream)) return; - _bloodstreamSystem.PumpToxins(mech.Body.OwnerUid, lung.Air, bloodstream); + _bloodstreamSystem.PumpToxins(((IComponent) mech.Body).Owner, lung.Air, bloodstream); var lungRemoved = lung.Air.RemoveRatio(0.5f); _atmosSys.Merge(to, lungRemoved); diff --git a/Content.Server/Body/Systems/MetabolizerSystem.cs b/Content.Server/Body/Systems/MetabolizerSystem.cs index 0f2229f879..39f77931c5 100644 --- a/Content.Server/Body/Systems/MetabolizerSystem.cs +++ b/Content.Server/Body/Systems/MetabolizerSystem.cs @@ -43,7 +43,7 @@ namespace Content.Server.Body.Systems { if (mech.Body != null) { - _solutionContainerSystem.EnsureSolution(mech.Body.OwnerUid, component.SolutionName); + _solutionContainerSystem.EnsureSolution(((IComponent) mech.Body).Owner, component.SolutionName); } } } @@ -61,7 +61,7 @@ namespace Content.Server.Body.Systems if (metab.AccumulatedFrametime >= metab.UpdateFrequency) { metab.AccumulatedFrametime -= metab.UpdateFrequency; - TryMetabolize(metab.OwnerUid, metab); + TryMetabolize(((IComponent) metab).Owner, metab); } } } @@ -86,9 +86,9 @@ namespace Content.Server.Body.Systems if (body != null) { - if (!Resolve(body.OwnerUid, ref manager, false)) + if (!Resolve(((IComponent) body).Owner, ref manager, false)) return; - _solutionContainerSystem.TryGetSolution(body.OwnerUid, meta.SolutionName, out solution, manager); + _solutionContainerSystem.TryGetSolution(((IComponent) body).Owner, meta.SolutionName, out solution, manager); solutionEntityUid = body.OwnerUid; } } @@ -152,7 +152,7 @@ namespace Content.Server.Body.Systems continue; } - var args = new ReagentEffectArgs(solutionEntityUid.Value, meta.OwnerUid, solution, proto, entry.MetabolismRate, + var args = new ReagentEffectArgs(solutionEntityUid.Value, ((IComponent) meta).Owner, solution, proto, entry.MetabolismRate, EntityManager, null); // do all effects, if conditions apply diff --git a/Content.Server/Body/Systems/RespiratorSystem.cs b/Content.Server/Body/Systems/RespiratorSystem.cs index 6f3cc8023f..4599e59f55 100644 --- a/Content.Server/Body/Systems/RespiratorSystem.cs +++ b/Content.Server/Body/Systems/RespiratorSystem.cs @@ -32,7 +32,7 @@ namespace Content.Server.Body.Systems foreach (var (respirator, blood, body) in EntityManager.EntityQuery()) { - var uid = respirator.OwnerUid; + var uid = ((IComponent) respirator).Owner; if (!EntityManager.TryGetComponent(uid, out var state) || state.IsDead()) { @@ -144,7 +144,7 @@ namespace Content.Server.Body.Systems foreach (var (lung, mech) in lungs) { - _lungSystem.UpdateLung(lung.OwnerUid, frameTime, lung, mech); + _lungSystem.UpdateLung(((IComponent) lung).Owner, frameTime, lung, mech); } foreach (var (gas, amountNeeded) in needs) @@ -159,7 +159,7 @@ namespace Content.Server.Body.Systems // Panic inhale foreach (var (lung, mech) in lungs) { - _lungSystem.Gasp(lung.OwnerUid, lung, mech); + _lungSystem.Gasp(((IComponent) lung).Owner, lung, mech); } } diff --git a/Content.Server/Body/Systems/StomachSystem.cs b/Content.Server/Body/Systems/StomachSystem.cs index dd35f61122..0b9df6d31b 100644 --- a/Content.Server/Body/Systems/StomachSystem.cs +++ b/Content.Server/Body/Systems/StomachSystem.cs @@ -35,11 +35,11 @@ namespace Content.Server.Body.Systems stomach.AccumulatedFrameTime -= stomach.UpdateInterval; // Get our solutions - if (!_solutionContainerSystem.TryGetSolution(stomach.OwnerUid, DefaultSolutionName, + if (!_solutionContainerSystem.TryGetSolution(((IComponent) stomach).Owner, DefaultSolutionName, out var stomachSolution, sol)) continue; - if (!_solutionContainerSystem.TryGetSolution(mech.Body.OwnerUid, stomach.BodySolutionName, + if (!_solutionContainerSystem.TryGetSolution(((IComponent) mech.Body).Owner, stomach.BodySolutionName, out var bodySolution)) continue; @@ -56,7 +56,7 @@ namespace Content.Server.Body.Systems if (quant > delta.Quantity) quant = delta.Quantity; - _solutionContainerSystem.TryRemoveReagent(stomach.OwnerUid, stomachSolution, + _solutionContainerSystem.TryRemoveReagent(((IComponent) stomach).Owner, stomachSolution, delta.ReagentId, quant); transferSolution.AddReagent(delta.ReagentId, quant); } @@ -71,7 +71,7 @@ namespace Content.Server.Body.Systems } // Transfer everything to the body solution! - _solutionContainerSystem.TryAddSolution(mech.Body.OwnerUid, bodySolution, transferSolution); + _solutionContainerSystem.TryAddSolution(((IComponent) mech.Body).Owner, bodySolution, transferSolution); } } diff --git a/Content.Server/Body/Systems/ThermalRegulatorSystem.cs b/Content.Server/Body/Systems/ThermalRegulatorSystem.cs index 95d4eaee7d..54daa2a4ee 100644 --- a/Content.Server/Body/Systems/ThermalRegulatorSystem.cs +++ b/Content.Server/Body/Systems/ThermalRegulatorSystem.cs @@ -22,7 +22,7 @@ public class ThermalRegulatorSystem : EntitySystem continue; regulator.AccumulatedFrametime -= 1; - ProcessThermalRegulation(regulator.OwnerUid, regulator); + ProcessThermalRegulation(((IComponent) regulator).Owner, regulator); } } diff --git a/Content.Server/Botany/Components/PlantHolderComponent.cs b/Content.Server/Botany/Components/PlantHolderComponent.cs index 8ae3a77ee1..55c136befc 100644 --- a/Content.Server/Botany/Components/PlantHolderComponent.cs +++ b/Content.Server/Botany/Components/PlantHolderComponent.cs @@ -563,10 +563,10 @@ namespace Content.Server.Botany.Components else { var amt = FixedPoint2.New(1); - foreach (var reagent in solutionSystem.RemoveEachReagent(OwnerUid, solution, amt)) + foreach (var reagent in solutionSystem.RemoveEachReagent(((IComponent) this).Owner, solution, amt)) { var reagentProto = _prototypeManager.Index(reagent); - reagentProto.ReactionPlant(OwnerUid, new Solution.ReagentQuantity(reagent, amt), solution); + reagentProto.ReactionPlant(((IComponent) this).Owner, new Solution.ReagentQuantity(reagent, amt), solution); } } diff --git a/Content.Server/Cargo/Components/CargoTelepadComponent.cs b/Content.Server/Cargo/Components/CargoTelepadComponent.cs index af83c5fa7a..d83581a34e 100644 --- a/Content.Server/Cargo/Components/CargoTelepadComponent.cs +++ b/Content.Server/Cargo/Components/CargoTelepadComponent.cs @@ -141,7 +141,7 @@ namespace Content.Server.Cargo.Components // attempt to attach the label if (IoCManager.Resolve().TryGetComponent(product, out PaperLabelComponent label)) { - EntitySystem.Get().TryInsert(OwnerUid, label.LabelSlot, printed); + EntitySystem.Get().TryInsert(((IComponent) this).Owner, label.LabelSlot, printed); } } diff --git a/Content.Server/Chemistry/Components/ChemMasterComponent.cs b/Content.Server/Chemistry/Components/ChemMasterComponent.cs index 2a64c13803..ac13cb21fd 100644 --- a/Content.Server/Chemistry/Components/ChemMasterComponent.cs +++ b/Content.Server/Chemistry/Components/ChemMasterComponent.cs @@ -123,7 +123,7 @@ namespace Content.Server.Chemistry.Components switch (msg.Action) { case UiAction.Eject: - EntitySystem.Get().TryEjectToHands(OwnerUid, BeakerSlot, obj.Session.AttachedEntityUid); + EntitySystem.Get().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntityUid); break; case UiAction.ChemButton: TransferReagent(msg.Id, msg.Amount, msg.IsBuffer); diff --git a/Content.Server/Chemistry/Components/InjectorComponent.cs b/Content.Server/Chemistry/Components/InjectorComponent.cs index 112cd10ccd..3f9928ed8b 100644 --- a/Content.Server/Chemistry/Components/InjectorComponent.cs +++ b/Content.Server/Chemistry/Components/InjectorComponent.cs @@ -192,7 +192,7 @@ namespace Content.Server.Chemistry.Components EntitySystem.Get().SplitSolution(user, targetBloodstream.Solution, realTransferAmount); var bloodstreamSys = EntitySystem.Get(); - bloodstreamSys.TryAddToBloodstream(targetBloodstream.OwnerUid, removedSolution, targetBloodstream); + bloodstreamSys.TryAddToBloodstream(((IComponent) targetBloodstream).Owner, removedSolution, targetBloodstream); removedSolution.DoEntityReaction(targetBloodstream.Owner, ReactionMethod.Injection); diff --git a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs index 7ced183099..520ce6173e 100644 --- a/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs +++ b/Content.Server/Chemistry/Components/ReagentDispenserComponent.cs @@ -148,7 +148,7 @@ namespace Content.Server.Chemistry.Components switch (msg.Button) { case UiButton.Eject: - EntitySystem.Get().TryEjectToHands(OwnerUid, BeakerSlot, obj.Session.AttachedEntityUid); + EntitySystem.Get().TryEjectToHands(((IComponent) this).Owner, BeakerSlot, obj.Session.AttachedEntityUid); break; case UiButton.Clear: TryClear(); diff --git a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs index 6a422134c9..62746227cd 100644 --- a/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs +++ b/Content.Server/Chemistry/EntitySystems/SolutionInjectOnCollideSystem.cs @@ -38,7 +38,7 @@ namespace Content.Server.Chemistry.EntitySystems var solToInject = solRemoved.SplitSolution(solRemovedVol * component.TransferEfficiency); - _bloodstreamSystem.TryAddToBloodstream(args.OtherFixture.Body.OwnerUid, solToInject, bloodstream); + _bloodstreamSystem.TryAddToBloodstream(((IComponent) args.OtherFixture.Body).Owner, solToInject, bloodstream); } } } diff --git a/Content.Server/Climbing/Components/ClimbingComponent.cs b/Content.Server/Climbing/Components/ClimbingComponent.cs index eec79514ec..c78430b4b6 100644 --- a/Content.Server/Climbing/Components/ClimbingComponent.cs +++ b/Content.Server/Climbing/Components/ClimbingComponent.cs @@ -81,11 +81,11 @@ namespace Content.Server.Climbing.Components // Since there are bodies with different masses: // mass * 5 seems enough to move entity - // instead of launching cats like rockets against the walls with constant impulse value. + // instead of launching cats like rockets against the walls with constant impulse value. Body.ApplyLinearImpulse((to - from).Normalized * velocity * Body.Mass * 5); OwnerIsTransitioning = true; - EntitySystem.Get().UnsetTransitionBoolAfterBufferTime(OwnerUid, this); + EntitySystem.Get().UnsetTransitionBoolAfterBufferTime(((IComponent) this).Owner, this); } public void Update() diff --git a/Content.Server/Construction/Components/MachineFrameComponent.cs b/Content.Server/Construction/Components/MachineFrameComponent.cs index 140b3cef9a..ce0474edbc 100644 --- a/Content.Server/Construction/Components/MachineFrameComponent.cs +++ b/Content.Server/Construction/Components/MachineFrameComponent.cs @@ -125,7 +125,7 @@ namespace Content.Server.Construction.Components if (IoCManager.Resolve().TryGetComponent(Owner, out var construction)) { // Attempt to set pathfinding to the machine node... - EntitySystem.Get().SetPathfindingTarget(OwnerUid, "machine", construction); + EntitySystem.Get().SetPathfindingTarget(((IComponent) this).Owner, "machine", construction); } } @@ -272,7 +272,7 @@ namespace Content.Server.Construction.Components if (IoCManager.Resolve().TryGetComponent(Owner, out ConstructionComponent? construction)) { // So prying the components off works correctly. - EntitySystem.Get().ResetEdge(OwnerUid, construction); + EntitySystem.Get().ResetEdge(((IComponent) this).Owner, construction); } return true; diff --git a/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs b/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs index 97ca2bc1de..b147cd2411 100644 --- a/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs +++ b/Content.Server/Disposal/Tube/Components/DisposalEntryComponent.cs @@ -32,7 +32,7 @@ namespace Content.Server.Disposal.Tube.Components EntitySystem.Get().Merge(holderComponent.Air, from.Air); from.Air.Clear(); - return EntitySystem.Get().EnterTube(holderComponent.OwnerUid, OwnerUid, holderComponent, null, this); + return EntitySystem.Get().EnterTube(((IComponent) holderComponent).Owner, ((IComponent) this).Owner, holderComponent, null, this); } protected override Direction[] ConnectableDirections() diff --git a/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs b/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs index 0e69aad6b8..4e9c794c08 100644 --- a/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs +++ b/Content.Server/Disposal/Tube/Components/DisposalTubeComponent.cs @@ -96,7 +96,7 @@ namespace Content.Server.Disposal.Tube.Components continue; } - EntitySystem.Get().ExitDisposals(holder.OwnerUid); + EntitySystem.Get().ExitDisposals(((IComponent) holder).Owner); } } diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs index a041908407..eb0f243784 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposableSystem.cs @@ -59,7 +59,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems if (duc != null) { // Insert into disposal unit - IoCManager.Resolve().GetComponent(entity).Coordinates = new EntityCoordinates(duc.OwnerUid, Vector2.Zero); + IoCManager.Resolve().GetComponent(entity).Coordinates = new EntityCoordinates(((IComponent) duc).Owner, Vector2.Zero); duc.Container.Insert(entity); } else @@ -154,7 +154,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems var currentTube = holder.CurrentTube; if (currentTube == null || currentTube.Deleted) { - ExitDisposals(holder.OwnerUid); + ExitDisposals(((IComponent) holder).Owner); break; } @@ -175,15 +175,15 @@ namespace Content.Server.Disposal.Unit.EntitySystems currentTube.Contents.ForceRemove(holder.Owner); // Find next tube - var nextTube = _disposalTubeSystem.NextTubeFor(currentTube.OwnerUid, holder.CurrentDirection); + var nextTube = _disposalTubeSystem.NextTubeFor(currentTube.Owner, holder.CurrentDirection); if (nextTube == null || nextTube.Deleted) { - ExitDisposals(holder.OwnerUid); + ExitDisposals(((IComponent) holder).Owner); break; } // Perform remainder of entry process - if (!EnterTube(holder.OwnerUid, nextTube.OwnerUid, holder, null, nextTube, null)) + if (!EnterTube(((IComponent) holder).Owner, nextTube.Owner, holder, null, nextTube, null)) { break; } diff --git a/Content.Server/Fluids/Components/MopComponent.cs b/Content.Server/Fluids/Components/MopComponent.cs index ca865fbc28..c74965f482 100644 --- a/Content.Server/Fluids/Components/MopComponent.cs +++ b/Content.Server/Fluids/Components/MopComponent.cs @@ -112,7 +112,7 @@ namespace Content.Server.Fluids.Components } if (!IoCManager.Resolve().TryGetComponent(eventArgs.Target, out PuddleComponent? puddleComponent) || - !solutionSystem.TryGetSolution(puddleComponent.OwnerUid, puddleComponent.SolutionName, out var puddleSolution)) + !solutionSystem.TryGetSolution(((IComponent) puddleComponent).Owner, puddleComponent.SolutionName, out var puddleSolution)) return false; // So if the puddle has 20 units we mop in 2 seconds. Don't just store CurrentVolume given it can change so need to re-calc it anyway. diff --git a/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs b/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs index 8aaa78ec3b..ed31c325cf 100644 --- a/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs +++ b/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs @@ -50,7 +50,7 @@ namespace Content.Server.Ghost.Roles.Components mob.EnsureComponent(); var ghostRoleSystem = EntitySystem.Get(); - ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, OwnerUid, mob, this); + ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, mob, this); if (++_currentTakeovers < _availableTakeovers) return true; diff --git a/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs b/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs index 187628a211..d78feb79b3 100644 --- a/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs +++ b/Content.Server/Ghost/Roles/Components/GhostTakeoverAvailableComponent.cs @@ -30,10 +30,10 @@ namespace Content.Server.Ghost.Roles.Components return false; if (MakeSentient) - MakeSentientCommand.MakeSentient(OwnerUid, IoCManager.Resolve()); + MakeSentientCommand.MakeSentient(((IComponent) this).Owner, IoCManager.Resolve()); var ghostRoleSystem = EntitySystem.Get(); - ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, OwnerUid, OwnerUid, this); + ghostRoleSystem.GhostRoleInternalCreateMindAndTransfer(session, ((IComponent) this).Owner, ((IComponent) this).Owner, this); ghostRoleSystem.UnregisterGhostRole(this); diff --git a/Content.Server/Instruments/InstrumentSystem.cs b/Content.Server/Instruments/InstrumentSystem.cs index a1617bbb93..986109672e 100644 --- a/Content.Server/Instruments/InstrumentSystem.cs +++ b/Content.Server/Instruments/InstrumentSystem.cs @@ -153,7 +153,7 @@ public sealed partial class InstrumentSystem : SharedInstrumentSystem var mob = instrument.InstrumentPlayer.AttachedEntity; // Just in case - Clean(instrument.OwnerUid); + Clean(((IComponent) instrument).Owner); instrument.UserInterface?.CloseAll(); if (mob != null) diff --git a/Content.Server/Inventory/Components/InventoryComponent.cs b/Content.Server/Inventory/Components/InventoryComponent.cs index 4a11405109..bd66b4281b 100644 --- a/Content.Server/Inventory/Components/InventoryComponent.cs +++ b/Content.Server/Inventory/Components/InventoryComponent.cs @@ -207,7 +207,7 @@ namespace Content.Server.Inventory.Components var pass = false; reason = null; - if (mobCheck && !EntitySystem.Get().CanEquip(OwnerUid)) + if (mobCheck && !EntitySystem.Get().CanEquip(((IComponent) this).Owner)) { reason = Loc.GetString("inventory-component-can-equip-cannot"); return false; @@ -295,7 +295,7 @@ namespace Content.Server.Inventory.Components private void UpdateMovementSpeed() { - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); } public void ForceUnequip(Slots slot) @@ -331,7 +331,7 @@ namespace Content.Server.Inventory.Components /// public bool CanUnequip(Slots slot, bool mobCheck = true) { - if (mobCheck && !EntitySystem.Get().CanUnequip(OwnerUid)) + if (mobCheck && !EntitySystem.Get().CanUnequip(((IComponent) this).Owner)) return false; var inventorySlot = _slotContainers[slot]; diff --git a/Content.Server/Kudzu/GrowingKudzuSystem.cs b/Content.Server/Kudzu/GrowingKudzuSystem.cs index b582429fcb..a752192cda 100644 --- a/Content.Server/Kudzu/GrowingKudzuSystem.cs +++ b/Content.Server/Kudzu/GrowingKudzuSystem.cs @@ -44,10 +44,10 @@ public class GrowingKudzuSystem : EntitySystem kudzu.GrowthLevel += 1; if (kudzu.GrowthLevel == 3 && - EntityManager.TryGetComponent(kudzu.OwnerUid, out var spreader)) + EntityManager.TryGetComponent(((IComponent) kudzu).Owner, out var spreader)) { // why cache when you can simply cease to be? Also saves a bit of memory/time. - EntityManager.RemoveComponent(kudzu.OwnerUid); + EntityManager.RemoveComponent(((IComponent) kudzu).Owner); } appearance.SetData(KudzuVisuals.GrowthLevel, kudzu.GrowthLevel); diff --git a/Content.Server/Kudzu/SpreaderSystem.cs b/Content.Server/Kudzu/SpreaderSystem.cs index 0a5ad3e293..851326c8f6 100644 --- a/Content.Server/Kudzu/SpreaderSystem.cs +++ b/Content.Server/Kudzu/SpreaderSystem.cs @@ -35,7 +35,7 @@ public class SpreaderSystem : EntitySystem private void OnAirtightChanged(AirtightChanged e) { - UpdateNearbySpreaders(e.Airtight.OwnerUid, e.Airtight); + UpdateNearbySpreaders(((IComponent) e.Airtight).Owner, e.Airtight); } private void SpreaderAddHandler(EntityUid uid, SpreaderComponent component, ComponentAdd args) diff --git a/Content.Server/Nuke/NukeCodeSystem.cs b/Content.Server/Nuke/NukeCodeSystem.cs index 18bd213ce9..a53c9fb77d 100644 --- a/Content.Server/Nuke/NukeCodeSystem.cs +++ b/Content.Server/Nuke/NukeCodeSystem.cs @@ -67,7 +67,7 @@ namespace Content.Server.Nuke var consoles = EntityManager.EntityQuery(); foreach (var console in consoles) { - if (!EntityManager.TryGetComponent(console.OwnerUid, out TransformComponent? transform)) + if (!EntityManager.TryGetComponent(((IComponent) console).Owner, out TransformComponent? transform)) continue; var consolePos = transform.MapPosition; diff --git a/Content.Server/Nutrition/Components/HungerComponent.cs b/Content.Server/Nutrition/Components/HungerComponent.cs index 070fed6c42..ce35c8e00b 100644 --- a/Content.Server/Nutrition/Components/HungerComponent.cs +++ b/Content.Server/Nutrition/Components/HungerComponent.cs @@ -90,7 +90,7 @@ namespace Content.Server.Nutrition.Components if (_lastHungerThreshold == HungerThreshold.Starving && _currentHungerThreshold != HungerThreshold.Dead && IoCManager.Resolve().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent)) { - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); } // Update UI @@ -126,7 +126,7 @@ namespace Content.Server.Nutrition.Components case HungerThreshold.Starving: // TODO: If something else bumps this could cause mega-speed. // If some form of speed update system if multiple things are touching it use that. - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); _lastHungerThreshold = _currentHungerThreshold; _actualDecayRate = _baseDecayRate * 0.6f; return; diff --git a/Content.Server/Nutrition/Components/ThirstComponent.cs b/Content.Server/Nutrition/Components/ThirstComponent.cs index f56866e8de..233aa87a75 100644 --- a/Content.Server/Nutrition/Components/ThirstComponent.cs +++ b/Content.Server/Nutrition/Components/ThirstComponent.cs @@ -89,7 +89,7 @@ namespace Content.Server.Nutrition.Components if (_lastThirstThreshold == ThirstThreshold.Parched && _currentThirstThreshold != ThirstThreshold.Dead && IoCManager.Resolve().TryGetComponent(Owner, out MovementSpeedModifierComponent? movementSlowdownComponent)) { - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); } // Update UI @@ -123,7 +123,7 @@ namespace Content.Server.Nutrition.Components return; case ThirstThreshold.Parched: - EntitySystem.Get().RefreshMovementSpeedModifiers(OwnerUid); + EntitySystem.Get().RefreshMovementSpeedModifiers(((IComponent) this).Owner); _lastThirstThreshold = _currentThirstThreshold; _actualDecayRate = _baseDecayRate * 0.6f; return; diff --git a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs index af585ce9fa..384310528e 100644 --- a/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/DrinkSystem.cs @@ -218,13 +218,13 @@ namespace Content.Server.Nutrition.EntitySystems public void UpdateAppearance(DrinkComponent component) { - if (!EntityManager.TryGetComponent(component.OwnerUid, out AppearanceComponent? appearance) || - !EntityManager.HasComponent(component.OwnerUid)) + if (!EntityManager.TryGetComponent(((IComponent) component).Owner, out AppearanceComponent? appearance) || + !EntityManager.HasComponent(((IComponent) component).Owner)) { return; } - var drainAvailable = _solutionContainerSystem.DrainAvailable(component.OwnerUid); + var drainAvailable = _solutionContainerSystem.DrainAvailable(((IComponent) component).Owner); appearance.SetData(FoodVisuals.Visual, drainAvailable.Float()); appearance.SetData(DrinkCanStateVisual.Opened, component.Opened); } @@ -248,7 +248,7 @@ namespace Content.Server.Nutrition.EntitySystems if (!EntityManager.TryGetComponent(userUid, out SharedBodyComponent? body)) return false; - if (!_solutionContainerSystem.TryGetDrainableSolution(drink.OwnerUid, out var drinkSolution) || + if (!_solutionContainerSystem.TryGetDrainableSolution(((IComponent) drink).Owner, out var drinkSolution) || drinkSolution.DrainAvailable <= 0) { _popupSystem.PopupEntity(Loc.GetString("drink-component-try-use-drink-is-empty", @@ -274,7 +274,7 @@ namespace Content.Server.Nutrition.EntitySystems var transferAmount = FixedPoint2.Min(drink.TransferAmount, drinkSolution.DrainAvailable); var drain = _solutionContainerSystem.Drain(uid, drinkSolution, transferAmount); var firstStomach = stomachs.FirstOrNull( - stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, drain)); + stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, drain)); // All stomach are full or can't handle whatever solution we have. if (firstStomach == null) @@ -299,7 +299,7 @@ namespace Content.Server.Nutrition.EntitySystems Filter.Pvs(userUid)); drain.DoEntityReaction(userUid, ReactionMethod.Ingestion); - _stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, drain, firstStomach.Value.Comp); + _stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, drain, firstStomach.Value.Comp); return true; } @@ -378,7 +378,7 @@ namespace Content.Server.Nutrition.EntitySystems { args.Drink.InUse = false; var transferAmount = FixedPoint2.Min(args.Drink.TransferAmount, args.DrinkSolution.DrainAvailable); - var drained = _solutionContainerSystem.Drain(args.Drink.OwnerUid, args.DrinkSolution, transferAmount); + var drained = _solutionContainerSystem.Drain(((IComponent) args.Drink).Owner, args.DrinkSolution, transferAmount); if (!_bodySystem.TryGetComponentsOnMechanisms(uid, out var stomachs, body)) { @@ -390,7 +390,7 @@ namespace Content.Server.Nutrition.EntitySystems } var firstStomach = stomachs.FirstOrNull( - stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, drained)); + stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, drained)); // All stomach are full or can't handle whatever solution we have. if (firstStomach == null) @@ -417,7 +417,7 @@ namespace Content.Server.Nutrition.EntitySystems SoundSystem.Play(Filter.Pvs(uid), args.Drink.UseSound.GetSound(), uid, AudioParams.Default.WithVolume(-2f)); drained.DoEntityReaction(uid, ReactionMethod.Ingestion); - _stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, drained, firstStomach.Value.Comp); + _stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, drained, firstStomach.Value.Comp); } private void OnForceDrinkCancelled(ForceDrinkCancelledEvent args) diff --git a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs index ac15ebb448..e6c4d59002 100644 --- a/Content.Server/Nutrition/EntitySystems/FoodSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/FoodSystem.cs @@ -158,7 +158,7 @@ namespace Content.Server.Nutrition.EntitySystems var transferAmount = component.TransferAmount != null ? FixedPoint2.Min((FixedPoint2) component.TransferAmount, solution.CurrentVolume) : solution.CurrentVolume; var split = _solutionContainerSystem.SplitSolution(uid, solution, transferAmount); var firstStomach = stomachs.FirstOrNull( - stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, split)); + stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, split)); if (firstStomach == null) { @@ -169,7 +169,7 @@ namespace Content.Server.Nutrition.EntitySystems // TODO: Account for partial transfer. split.DoEntityReaction(userUid, ReactionMethod.Ingestion); - _stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, split, firstStomach.Value.Comp); + _stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, split, firstStomach.Value.Comp); SoundSystem.Play(Filter.Pvs(userUid), component.UseSound.GetSound(), userUid, AudioParams.Default.WithVolume(-1f)); _popupSystem.PopupEntity(Loc.GetString(component.EatMessage, ("food", component.Owner)), userUid, Filter.Entities(userUid)); @@ -177,7 +177,7 @@ namespace Content.Server.Nutrition.EntitySystems // Try to break all used utensils foreach (var utensil in usedUtensils) { - _utensilSystem.TryBreak(utensil.OwnerUid, userUid); + _utensilSystem.TryBreak(((IComponent) utensil).Owner, userUid); } if (component.UsesRemaining > 0) @@ -186,7 +186,7 @@ namespace Content.Server.Nutrition.EntitySystems } if (string.IsNullOrEmpty(component.TrashPrototype)) - EntityManager.QueueDeleteEntity(component.OwnerUid); + EntityManager.QueueDeleteEntity(((IComponent) component).Owner); else DeleteAndSpawnTrash(component, userUid); @@ -204,7 +204,7 @@ namespace Content.Server.Nutrition.EntitySystems EntityManager.TryGetComponent(userUid.Value, out HandsComponent? handsComponent) && handsComponent.IsHolding(component.Owner)) { - EntityManager.DeleteEntity(component.OwnerUid); + EntityManager.DeleteEntity(((IComponent) component).Owner); // Put the trash in the user's hand if (IoCManager.Resolve().TryGetComponent(finisher, out ItemComponent? item) && @@ -215,7 +215,7 @@ namespace Content.Server.Nutrition.EntitySystems return; } - EntityManager.QueueDeleteEntity(component.OwnerUid); + EntityManager.QueueDeleteEntity(((IComponent) component).Owner); } private void AddEatVerb(EntityUid uid, FoodComponent component, GetInteractionVerbsEvent ev) @@ -313,9 +313,9 @@ namespace Content.Server.Nutrition.EntitySystems ? FixedPoint2.Min((FixedPoint2) args.Food.TransferAmount, args.FoodSolution.CurrentVolume) : args.FoodSolution.CurrentVolume; - var split = _solutionContainerSystem.SplitSolution(args.Food.OwnerUid, args.FoodSolution, transferAmount); + var split = _solutionContainerSystem.SplitSolution(((IComponent) args.Food).Owner, args.FoodSolution, transferAmount); var firstStomach = stomachs.FirstOrNull( - stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, split)); + stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, split)); if (firstStomach == null) { @@ -325,7 +325,7 @@ namespace Content.Server.Nutrition.EntitySystems } split.DoEntityReaction(uid, ReactionMethod.Ingestion); - _stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, split, firstStomach.Value.Comp); + _stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, split, firstStomach.Value.Comp); EntityManager.TryGetComponent(uid, out MetaDataComponent? targetMeta); var targetName = targetMeta?.EntityName ?? string.Empty; @@ -344,14 +344,14 @@ namespace Content.Server.Nutrition.EntitySystems // Try to break all used utensils foreach (var utensil in args.Utensils) { - _utensilSystem.TryBreak(utensil.OwnerUid, args.User); + _utensilSystem.TryBreak(((IComponent) utensil).Owner, args.User); } if (args.Food.UsesRemaining > 0) return; if (string.IsNullOrEmpty(args.Food.TrashPrototype)) - EntityManager.QueueDeleteEntity(args.Food.OwnerUid); + EntityManager.QueueDeleteEntity(((IComponent) args.Food).Owner); else DeleteAndSpawnTrash(args.Food, args.User); } @@ -377,7 +377,7 @@ namespace Content.Server.Nutrition.EntitySystems DeleteAndSpawnTrash(food); var firstStomach = stomachs.FirstOrNull( - stomach => _stomachSystem.CanTransferSolution(stomach.Comp.OwnerUid, foodSolution)); + stomach => _stomachSystem.CanTransferSolution(((IComponent) stomach.Comp).Owner, foodSolution)); if (firstStomach == null) return; @@ -395,11 +395,11 @@ namespace Content.Server.Nutrition.EntitySystems _popupSystem.PopupEntity(Loc.GetString(food.EatMessage), target, filter); foodSolution.DoEntityReaction(uid, ReactionMethod.Ingestion); - _stomachSystem.TryTransferSolution(firstStomach.Value.Comp.OwnerUid, foodSolution, firstStomach.Value.Comp); + _stomachSystem.TryTransferSolution(((IComponent) firstStomach.Value.Comp).Owner, foodSolution, firstStomach.Value.Comp); SoundSystem.Play(Filter.Pvs(target), food.UseSound.GetSound(), target, AudioParams.Default.WithVolume(-1f)); if (string.IsNullOrEmpty(food.TrashPrototype)) - EntityManager.QueueDeleteEntity(food.OwnerUid); + EntityManager.QueueDeleteEntity(((IComponent) food).Owner); else DeleteAndSpawnTrash(food); } @@ -470,7 +470,7 @@ namespace Content.Server.Nutrition.EntitySystems // check helmets. Note that not all helmets cover the face. if (inventory.TryGetSlotItem(EquipmentSlotDefines.Slots.HEAD, out ItemComponent? head) && - EntityManager.TryGetComponent(head.OwnerUid, out TagComponent tag) && + EntityManager.TryGetComponent(((IComponent) head).Owner, out TagComponent tag) && tag.HasTag("ConcealsFace")) { blockingEntity = head.OwnerUid; diff --git a/Content.Server/Physics/Controllers/MoverController.cs b/Content.Server/Physics/Controllers/MoverController.cs index c3d94d39c2..a756e6bf2e 100644 --- a/Content.Server/Physics/Controllers/MoverController.cs +++ b/Content.Server/Physics/Controllers/MoverController.cs @@ -108,7 +108,7 @@ namespace Content.Server.Physics.Controllers // then do the movement input once for it. foreach (var (shuttle, pilots) in _shuttlePilots) { - if (shuttle.Paused || !EntityManager.TryGetComponent(shuttle.OwnerUid, out PhysicsComponent? body)) continue; + if (shuttle.Paused || !EntityManager.TryGetComponent(((IComponent) shuttle).Owner, out PhysicsComponent? body)) continue; // Collate movement linear and angular inputs together var linearInput = Vector2.Zero; @@ -131,7 +131,7 @@ namespace Content.Server.Physics.Controllers if (sprint.Equals(Vector2.Zero)) continue; - var offsetRotation = EntityManager.GetComponent(console.OwnerUid).LocalRotation; + var offsetRotation = EntityManager.GetComponent(((IComponent) console).Owner).LocalRotation; linearInput += offsetRotation.RotateVec(new Vector2(0f, sprint.Y)); angularInput += sprint.X; @@ -153,7 +153,7 @@ namespace Content.Server.Physics.Controllers if (sprint.Equals(Vector2.Zero)) continue; - var offsetRotation = EntityManager.GetComponent(console.OwnerUid).LocalRotation; + var offsetRotation = EntityManager.GetComponent(((IComponent) console).Owner).LocalRotation; sprint = offsetRotation.RotateVec(sprint); linearInput += sprint; @@ -180,7 +180,7 @@ namespace Content.Server.Physics.Controllers var angle = linearInput.ToWorldAngle(); var linearDir = angle.GetDir(); var dockFlag = linearDir.AsFlag(); - var shuttleNorth = EntityManager.GetComponent(body.OwnerUid).WorldRotation.ToWorldVec(); + var shuttleNorth = EntityManager.GetComponent(((IComponent) body).Owner).WorldRotation.ToWorldVec(); // Won't just do cardinal directions. foreach (DirectionFlag dir in Enum.GetValues(typeof(DirectionFlag))) diff --git a/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs b/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs index b7c81ee32e..b8a40e0c66 100644 --- a/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs +++ b/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs @@ -180,7 +180,7 @@ namespace Content.Server.PneumaticCannon if (storage.StoredEntities == null) return; if (storage.StoredEntities.Count == 0) { - SoundSystem.Play(Filter.Pvs(comp.OwnerUid), "/Audio/Weapons/click.ogg", comp.OwnerUid, AudioParams.Default); + SoundSystem.Play(Filter.Pvs(((IComponent) comp).Owner), "/Audio/Weapons/click.ogg", ((IComponent) comp).Owner, AudioParams.Default); return; } @@ -217,7 +217,7 @@ namespace Content.Server.PneumaticCannon { data.User.PopupMessage(Loc.GetString("pneumatic-cannon-component-fire-no-gas", ("cannon", comp.Owner))); - SoundSystem.Play(Filter.Pvs(comp.OwnerUid), "/Audio/Items/hiss.ogg", comp.OwnerUid, AudioParams.Default); + SoundSystem.Play(Filter.Pvs(((IComponent) comp).Owner), "/Audio/Items/hiss.ogg", ((IComponent) comp).Owner, AudioParams.Default); return; } @@ -233,7 +233,7 @@ namespace Content.Server.PneumaticCannon IEntity ent = _random.Pick(storage.StoredEntities); storage.Remove(ent); - SoundSystem.Play(Filter.Pvs(data.User), comp.FireSound.GetSound(), comp.OwnerUid, AudioParams.Default); + SoundSystem.Play(Filter.Pvs(data.User), comp.FireSound.GetSound(), ((IComponent) comp).Owner, AudioParams.Default); if (IoCManager.Resolve().TryGetComponent(data.User, out var recoil)) { recoil.Kick(Vector2.One * data.Strength); diff --git a/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs b/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs index fb3c43572e..709ddd2015 100644 --- a/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs +++ b/Content.Server/Power/EntitySystems/ExtensionCableSystem.cs @@ -68,7 +68,7 @@ namespace Content.Server.Power.EntitySystems { // No point resetting what the receiver is doing if it's deleting, plus significant perf savings // in not doing needless lookups - if (EntityManager.GetComponent(receiver.OwnerUid).EntityLifeStage > + if (EntityManager.GetComponent(((IComponent) receiver).Owner).EntityLifeStage > EntityLifeStage.MapInitialized) continue; TryFindAndSetProvider(receiver); diff --git a/Content.Server/PowerCell/Components/PowerCellComponent.cs b/Content.Server/PowerCell/Components/PowerCellComponent.cs index 4d84d1acaf..7f973ee935 100644 --- a/Content.Server/PowerCell/Components/PowerCellComponent.cs +++ b/Content.Server/PowerCell/Components/PowerCellComponent.cs @@ -73,7 +73,7 @@ namespace Content.Server.PowerCell.Components var light = (int) Math.Ceiling(Math.Sqrt(CurrentCharge) / 30); CurrentCharge = 0; - EntitySystem.Get().SpawnExplosion(OwnerUid, 0, heavy, light, light*2); + EntitySystem.Get().SpawnExplosion(((IComponent) this).Owner, 0, heavy, light, light*2); IoCManager.Resolve().DeleteEntity((EntityUid) Owner); } diff --git a/Content.Server/Shuttles/Components/ThrusterComponent.cs b/Content.Server/Shuttles/Components/ThrusterComponent.cs index c91828d0da..743183ec8c 100644 --- a/Content.Server/Shuttles/Components/ThrusterComponent.cs +++ b/Content.Server/Shuttles/Components/ThrusterComponent.cs @@ -33,11 +33,11 @@ namespace Content.Server.Shuttles.Components if (!_enabled) { - system.DisableThruster(OwnerUid, this); + system.DisableThruster(((IComponent) this).Owner, this); } - else if (system.CanEnable(OwnerUid, this)) + else if (system.CanEnable(((IComponent) this).Owner, this)) { - system.EnableThruster(OwnerUid, this); + system.EnableThruster(((IComponent) this).Owner, this); } } } diff --git a/Content.Server/Shuttles/EntitySystems/DockingSystem.cs b/Content.Server/Shuttles/EntitySystems/DockingSystem.cs index 56cea164f9..a32f43b9e5 100644 --- a/Content.Server/Shuttles/EntitySystems/DockingSystem.cs +++ b/Content.Server/Shuttles/EntitySystems/DockingSystem.cs @@ -112,7 +112,7 @@ namespace Content.Server.Shuttles.EntitySystems if (dockingFixture == null) { DebugTools.Assert(false); - Logger.ErrorS("docking", $"Found null fixture on {EntityManager.GetEntity(body.OwnerUid)}"); + Logger.ErrorS("docking", $"Found null fixture on {EntityManager.GetEntity(((IComponent) body).Owner)}"); return null; } @@ -183,7 +183,7 @@ namespace Content.Server.Shuttles.EntitySystems if (dockB == null || dockA.DockJoint == null) { DebugTools.Assert(false); - Logger.Error("docking", $"Tried to cleanup {dockA.OwnerUid} but not docked?"); + Logger.Error("docking", $"Tried to cleanup {((IComponent) dockA).Owner} but not docked?"); dockA.DockedWith = null; if (dockA.DockJoint != null) @@ -202,8 +202,8 @@ namespace Content.Server.Shuttles.EntitySystems dockA.DockedWith = null; // If these grids are ever invalid then need to look at fixing ordering for unanchored events elsewhere. - var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent(dockA.OwnerUid).GridID).GridEntityId; - var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent(dockB.OwnerUid).GridID).GridEntityId; + var gridAUid = _mapManager.GetGrid(EntityManager.GetComponent(((IComponent) dockA).Owner).GridID).GridEntityId; + var gridBUid = _mapManager.GetGrid(EntityManager.GetComponent(((IComponent) dockB).Owner).GridID).GridEntityId; var msg = new UndockEvent { @@ -213,8 +213,8 @@ namespace Content.Server.Shuttles.EntitySystems GridBUid = gridBUid, }; - EntityManager.EventBus.RaiseLocalEvent(dockA.OwnerUid, msg, false); - EntityManager.EventBus.RaiseLocalEvent(dockB.OwnerUid, msg, false); + EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false); + EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false); EntityManager.EventBus.RaiseEvent(EventSource.Local, msg); } @@ -310,8 +310,8 @@ namespace Content.Server.Shuttles.EntitySystems // We could also potentially use a prismatic joint? Depending if we want clamps that can extend or whatever - var dockAXform = EntityManager.GetComponent(dockA.OwnerUid); - var dockBXform = EntityManager.GetComponent(dockB.OwnerUid); + var dockAXform = EntityManager.GetComponent(((IComponent) dockA).Owner); + var dockBXform = EntityManager.GetComponent(((IComponent) dockB).Owner); var gridA = _mapManager.GetGrid(dockAXform.GridID).GridEntityId; var gridB = _mapManager.GetGrid(dockBXform.GridID).GridEntityId; @@ -326,7 +326,7 @@ namespace Content.Server.Shuttles.EntitySystems // These need playing around with // Could also potentially have collideconnected false and stiffness 0 but it was a bit more suss??? - var joint = _jointSystem.CreateWeldJoint(gridA, gridB, DockingJoint + dockA.OwnerUid); + var joint = _jointSystem.CreateWeldJoint(gridA, gridB, DockingJoint + ((IComponent) dockA).Owner); var gridAXform = EntityManager.GetComponent(gridA); var gridBXform = EntityManager.GetComponent(gridB); @@ -346,13 +346,13 @@ namespace Content.Server.Shuttles.EntitySystems dockA.DockJoint = joint; dockB.DockJoint = joint; - if (EntityManager.TryGetComponent(dockA.OwnerUid, out ServerDoorComponent? doorA)) + if (EntityManager.TryGetComponent(((IComponent) dockA).Owner, out ServerDoorComponent? doorA)) { doorA.ChangeAirtight = false; doorA.Open(); } - if (EntityManager.TryGetComponent(dockB.OwnerUid, out ServerDoorComponent? doorB)) + if (EntityManager.TryGetComponent(((IComponent) dockB).Owner, out ServerDoorComponent? doorB)) { doorB.ChangeAirtight = false; doorB.Open(); @@ -366,8 +366,8 @@ namespace Content.Server.Shuttles.EntitySystems GridBUid = gridB, }; - EntityManager.EventBus.RaiseLocalEvent(dockA.OwnerUid, msg, false); - EntityManager.EventBus.RaiseLocalEvent(dockB.OwnerUid, msg, false); + EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockA).Owner, msg, false); + EntityManager.EventBus.RaiseLocalEvent(((IComponent) dockB).Owner, msg, false); EntityManager.EventBus.RaiseEvent(EventSource.Local, msg); } @@ -376,8 +376,8 @@ namespace Content.Server.Shuttles.EntitySystems /// private void TryDock(DockingComponent dockA, DockingComponent dockB) { - if (!EntityManager.TryGetComponent(dockA.OwnerUid, out PhysicsComponent? bodyA) || - !EntityManager.TryGetComponent(dockB.OwnerUid, out PhysicsComponent? bodyB) || + if (!EntityManager.TryGetComponent(((IComponent) dockA).Owner, out PhysicsComponent? bodyA) || + !EntityManager.TryGetComponent(((IComponent) dockB).Owner, out PhysicsComponent? bodyB) || !dockA.Enabled || !dockB.Enabled) { @@ -423,17 +423,17 @@ namespace Content.Server.Shuttles.EntitySystems if (dock.DockedWith == null) { DebugTools.Assert(false); - Logger.ErrorS("docking", $"Tried to undock {dock.OwnerUid} but not docked with anything?"); + Logger.ErrorS("docking", $"Tried to undock {((IComponent) dock).Owner} but not docked with anything?"); return; } - if (EntityManager.TryGetComponent(dock.OwnerUid, out ServerDoorComponent? doorA)) + if (EntityManager.TryGetComponent(((IComponent) dock).Owner, out ServerDoorComponent? doorA)) { doorA.ChangeAirtight = true; doorA.Close(); } - if (EntityManager.TryGetComponent(dock.DockedWith.OwnerUid, out ServerDoorComponent? doorB)) + if (EntityManager.TryGetComponent(((IComponent) dock.DockedWith).Owner, out ServerDoorComponent? doorB)) { doorB.ChangeAirtight = true; doorB.Close(); diff --git a/Content.Server/Shuttles/EntitySystems/ShuttleConsoleSystem.cs b/Content.Server/Shuttles/EntitySystems/ShuttleConsoleSystem.cs index f29cc8fbf9..e62d81a343 100644 --- a/Content.Server/Shuttles/EntitySystems/ShuttleConsoleSystem.cs +++ b/Content.Server/Shuttles/EntitySystems/ShuttleConsoleSystem.cs @@ -39,7 +39,7 @@ namespace Content.Server.Shuttles.EntitySystems { if (comp.Console == null) continue; - if (!_blocker.CanInteract(comp.OwnerUid)) + if (!_blocker.CanInteract(((IComponent) comp).Owner)) { toRemove.Add(comp); } diff --git a/Content.Server/Shuttles/EntitySystems/ThrusterSystem.cs b/Content.Server/Shuttles/EntitySystems/ThrusterSystem.cs index 698e7322de..891d902fe7 100644 --- a/Content.Server/Shuttles/EntitySystems/ThrusterSystem.cs +++ b/Content.Server/Shuttles/EntitySystems/ThrusterSystem.cs @@ -397,14 +397,14 @@ namespace Content.Server.Shuttles.EntitySystems if (args.OurFixture.ID != BurnFixture) return; _activeThrusters.Add(component); - component.Colliding.Add(args.OtherFixture.Body.OwnerUid); + component.Colliding.Add(((IComponent) args.OtherFixture.Body).Owner); } private void OnEndCollide(EntityUid uid, ThrusterComponent component, EndCollideEvent args) { if (args.OurFixture.ID != BurnFixture) return; - component.Colliding.Remove(args.OtherFixture.Body.OwnerUid); + component.Colliding.Remove(((IComponent) args.OtherFixture.Body).Owner); if (component.Colliding.Count == 0) { @@ -425,7 +425,7 @@ namespace Content.Server.Shuttles.EntitySystems foreach (var comp in component.LinearThrusters[index]) { - if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent)) + if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent)) continue; comp.Firing = true; @@ -446,7 +446,7 @@ namespace Content.Server.Shuttles.EntitySystems foreach (var comp in component.LinearThrusters[index]) { - if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent)) + if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent)) continue; comp.Firing = false; @@ -470,7 +470,7 @@ namespace Content.Server.Shuttles.EntitySystems { foreach (var comp in component.AngularThrusters) { - if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent)) + if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent)) continue; comp.Firing = true; @@ -481,7 +481,7 @@ namespace Content.Server.Shuttles.EntitySystems { foreach (var comp in component.AngularThrusters) { - if (!EntityManager.TryGetComponent(comp.OwnerUid, out AppearanceComponent? appearanceComponent)) + if (!EntityManager.TryGetComponent(((IComponent) comp).Owner, out AppearanceComponent? appearanceComponent)) continue; comp.Firing = false; diff --git a/Content.Server/Solar/EntitySystems/PowerSolarSystem.cs b/Content.Server/Solar/EntitySystems/PowerSolarSystem.cs index d44d00949b..8b05842d63 100644 --- a/Content.Server/Solar/EntitySystems/PowerSolarSystem.cs +++ b/Content.Server/Solar/EntitySystems/PowerSolarSystem.cs @@ -166,7 +166,7 @@ namespace Content.Server.Solar.EntitySystems // Total coverage calculated; apply it to the panel. panel.Coverage = coverage; - UpdateSupply(panel.OwnerUid, panel); + UpdateSupply(((IComponent) panel).Owner, panel); } public void UpdateSupply( diff --git a/Content.Server/StationEvents/Events/RadiationStorm.cs b/Content.Server/StationEvents/Events/RadiationStorm.cs index 37df944474..69706c8a68 100644 --- a/Content.Server/StationEvents/Events/RadiationStorm.cs +++ b/Content.Server/StationEvents/Events/RadiationStorm.cs @@ -70,7 +70,8 @@ namespace Content.Server.StationEvents.Events // Account for split stations by just randomly picking a piece of it. var possibleTargets = _entityManager.EntityQuery() .Where(x => x.Station == _target).ToArray(); - var stationEnt = _robustRandom.Pick(possibleTargets).OwnerUid; + StationComponent tempQualifier = _robustRandom.Pick(possibleTargets); + var stationEnt = ((IComponent) tempQualifier).Owner; if (!_entityManager.TryGetComponent(stationEnt, out var grid)) return; diff --git a/Content.Server/Storage/Components/EntityStorageComponent.cs b/Content.Server/Storage/Components/EntityStorageComponent.cs index 248ea45536..bdfa7acef0 100644 --- a/Content.Server/Storage/Components/EntityStorageComponent.cs +++ b/Content.Server/Storage/Components/EntityStorageComponent.cs @@ -225,7 +225,7 @@ namespace Content.Server.Storage.Components var targetIsItem = IoCManager.Resolve().HasComponent(entity); var targetIsMob = IoCManager.Resolve().HasComponent(entity); - var storageIsItem = IoCManager.Resolve().HasComponent(OwnerUid); + var storageIsItem = IoCManager.Resolve().HasComponent(((IComponent) this).Owner); var allowedToEat = false; diff --git a/Content.Server/Storage/Components/ServerStorageComponent.cs b/Content.Server/Storage/Components/ServerStorageComponent.cs index 5d1cb9f037..ca393f8a09 100644 --- a/Content.Server/Storage/Components/ServerStorageComponent.cs +++ b/Content.Server/Storage/Components/ServerStorageComponent.cs @@ -94,7 +94,7 @@ namespace Content.Server.Storage.Components private void UpdateStorageVisualization() { - if (!_entityManager.TryGetComponent(OwnerUid, out AppearanceComponent appearance)) + if (!_entityManager.TryGetComponent(((IComponent) this).Owner, out AppearanceComponent appearance)) return; bool open = SubscribedSessions.Count != 0; @@ -102,7 +102,7 @@ namespace Content.Server.Storage.Components appearance.SetData(StorageVisuals.Open, open); appearance.SetData(SharedBagOpenVisuals.BagState, open ? SharedBagState.Open : SharedBagState.Closed); - if (_entityManager.HasComponent(OwnerUid)) + if (_entityManager.HasComponent(((IComponent) this).Owner)) appearance.SetData(StackVisuals.Hide, !open); } @@ -402,7 +402,7 @@ namespace Content.Server.Storage.Components { if (_entityManager.TryGetComponent(entity, out ServerStorageComponent storageComponent)) { - DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {OwnerUid}"); + DebugTools.Assert(storageComponent != this, $"Storage component contains itself!? Entity: {((IComponent) this).Owner}"); storageComponent.UnsubscribeSession(session); } diff --git a/Content.Server/Tabletop/TabletopSystem.cs b/Content.Server/Tabletop/TabletopSystem.cs index 7785eae8e6..66b22a77f3 100644 --- a/Content.Server/Tabletop/TabletopSystem.cs +++ b/Content.Server/Tabletop/TabletopSystem.cs @@ -103,7 +103,7 @@ namespace Content.Server.Tabletop return; }; - var gamerUid = gamer.OwnerUid; + var gamerUid = ((IComponent) gamer).Owner; if (actor.PlayerSession.Status > SessionStatus.Connected || CanSeeTable(gamerUid, gamer.Tabletop) || !StunnedOrNoHands(gamerUid)) diff --git a/Content.Server/Temperature/Systems/TemperatureSystem.cs b/Content.Server/Temperature/Systems/TemperatureSystem.cs index ea2cbc6a74..2bbd4de2fb 100644 --- a/Content.Server/Temperature/Systems/TemperatureSystem.cs +++ b/Content.Server/Temperature/Systems/TemperatureSystem.cs @@ -59,7 +59,7 @@ namespace Content.Server.Temperature.Systems if (comp.Deleted || comp.Paused) continue; - ChangeDamage(comp.OwnerUid, comp); + ChangeDamage(((IComponent) comp).Owner, comp); } ShouldUpdateDamage.Clear(); diff --git a/Content.Server/UserInterface/ActivatableUISystem.cs b/Content.Server/UserInterface/ActivatableUISystem.cs index 6e051a7e64..ae57fdfbc1 100644 --- a/Content.Server/UserInterface/ActivatableUISystem.cs +++ b/Content.Server/UserInterface/ActivatableUISystem.cs @@ -91,10 +91,10 @@ namespace Content.Server.UserInterface // If we've gotten this far, fire a cancellable event that indicates someone is about to activate this. // This is so that stuff can require further conditions (like power). var oae = new ActivatableUIOpenAttemptEvent(user); - RaiseLocalEvent(aui.OwnerUid, oae, false); + RaiseLocalEvent(((IComponent) aui).Owner, oae, false); if (oae.Cancelled) return false; - SetCurrentSingleUser(aui.OwnerUid, actor.PlayerSession, aui); + SetCurrentSingleUser(((IComponent) aui).Owner, actor.PlayerSession, aui); ui.Toggle(actor.PlayerSession); return true; } diff --git a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs index 8afa847a6f..a35eac7772 100644 --- a/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs +++ b/Content.Server/Weapon/Melee/MeleeWeaponSystem.cs @@ -287,7 +287,7 @@ namespace Content.Server.Weapon.Melee foreach (var bloodstream in hitBloodstreams) { var individualInjection = solutionToInject.SplitSolution(volPerBloodstream); - _bloodstreamSystem.TryAddToBloodstream(bloodstream.OwnerUid, individualInjection, bloodstream); + _bloodstreamSystem.TryAddToBloodstream(((IComponent) bloodstream).Owner, individualInjection, bloodstream); } } diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs index f06767b3a4..3fd6c97c2c 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs @@ -365,7 +365,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components IoCManager.Resolve().GetComponent(projectile).WorldRotation = projectileAngle + MathHelper.PiOver2; } - IoCManager.Resolve().EventBus.RaiseLocalEvent(OwnerUid, new GunShotEvent(firedProjectiles)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new GunShotEvent(firedProjectiles)); IoCManager.Resolve().EventBus.RaiseLocalEvent(ammo, new AmmoShotEvent(firedProjectiles)); } diff --git a/Content.Shared/Actions/Components/ItemActionsComponent.cs b/Content.Shared/Actions/Components/ItemActionsComponent.cs index db42d9f5d3..acbd4b2fa3 100644 --- a/Content.Shared/Actions/Components/ItemActionsComponent.cs +++ b/Content.Shared/Actions/Components/ItemActionsComponent.cs @@ -86,7 +86,7 @@ namespace Content.Shared.Actions.Components if (_holderActionsComponent == null) return; foreach (var (actionType, state) in _actions) { - _holderActionsComponent.GrantOrUpdateItemAction(actionType, OwnerUid, state); + _holderActionsComponent.GrantOrUpdateItemAction(actionType, ((IComponent) this).Owner, state); } } @@ -95,7 +95,7 @@ namespace Content.Shared.Actions.Components if (_holderActionsComponent == null) return; foreach (var (actionType, state) in _actions) { - _holderActionsComponent.RevokeItemAction(actionType, OwnerUid); + _holderActionsComponent.RevokeItemAction(actionType, ((IComponent) this).Owner); } } @@ -152,7 +152,7 @@ namespace Content.Shared.Actions.Components if (!dirty) return; _actions[actionType] = actionState; - _holderActionsComponent?.GrantOrUpdateItemAction(actionType, OwnerUid, actionState); + _holderActionsComponent?.GrantOrUpdateItemAction(actionType, ((IComponent) this).Owner, actionState); } /// diff --git a/Content.Shared/Body/Components/SharedBodyComponent.cs b/Content.Shared/Body/Components/SharedBodyComponent.cs index 9c39100706..98b21d97b3 100644 --- a/Content.Shared/Body/Components/SharedBodyComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyComponent.cs @@ -146,7 +146,7 @@ namespace Content.Shared.Body.Components var argsAdded = new BodyPartAddedEventArgs(slot.Id, part); - EntitySystem.Get().BodyPartAdded(OwnerUid, argsAdded); + EntitySystem.Get().BodyPartAdded(((IComponent) this).Owner, argsAdded); foreach (var component in IoCManager.Resolve().GetComponents(Owner).ToArray()) { component.BodyPartAdded(argsAdded); @@ -174,7 +174,7 @@ namespace Content.Shared.Body.Components var args = new BodyPartRemovedEventArgs(slot.Id, part); - EntitySystem.Get().BodyPartRemoved(OwnerUid, args); + EntitySystem.Get().BodyPartRemoved(((IComponent) this).Owner, args); foreach (var component in IoCManager.Resolve().GetComponents(Owner)) { component.BodyPartRemoved(args); @@ -184,14 +184,14 @@ namespace Content.Shared.Body.Components if (part.PartType == BodyPartType.Leg && GetPartsOfType(BodyPartType.Leg).ToArray().Length == 0) { - EntitySystem.Get().Down(OwnerUid); + EntitySystem.Get().Down(((IComponent) this).Owner); } if (part.IsVital && SlotParts.Count(x => x.Value.PartType == part.PartType) == 0) { // TODO BODY SYSTEM KILL : Find a more elegant way of killing em than just dumping bloodloss damage. var damage = new DamageSpecifier(_prototypeManager.Index("Bloodloss"), 300); - EntitySystem.Get().TryChangeDamage(part.OwnerUid, damage); + EntitySystem.Get().TryChangeDamage(((IComponent) part).Owner, damage); } OnBodyChanged(); @@ -468,7 +468,7 @@ namespace Content.Shared.Body.Components var i = 0; foreach (var (part, slot) in SlotParts) { - parts[i] = (slot.Id, part.OwnerUid); + parts[i] = (slot.Id, OwnerUid: ((IComponent) part).Owner); i++; } diff --git a/Content.Shared/Body/Components/SharedBodyPartComponent.cs b/Content.Shared/Body/Components/SharedBodyPartComponent.cs index 619f9ef81c..750d248846 100644 --- a/Content.Shared/Body/Components/SharedBodyPartComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyPartComponent.cs @@ -305,7 +305,7 @@ namespace Content.Shared.Body.Components foreach (var mechanism in _mechanisms) { - IoCManager.Resolve().EventBus.RaiseLocalEvent(mechanism.OwnerUid, new AddedToBodyEvent(body)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) mechanism).Owner, new AddedToBodyEvent(body)); } } @@ -320,7 +320,7 @@ namespace Content.Shared.Body.Components foreach (var mechanism in _mechanisms) { - IoCManager.Resolve().EventBus.RaiseLocalEvent(mechanism.OwnerUid, new RemovedFromBodyEvent(old)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) mechanism).Owner, new RemovedFromBodyEvent(old)); } } diff --git a/Content.Shared/Body/Components/SharedMechanismComponent.cs b/Content.Shared/Body/Components/SharedMechanismComponent.cs index 18b41ca1b9..eff45e15bf 100644 --- a/Content.Shared/Body/Components/SharedMechanismComponent.cs +++ b/Content.Shared/Body/Components/SharedMechanismComponent.cs @@ -37,11 +37,11 @@ namespace Content.Shared.Body.Components { if (old.Body == null) { - IoCManager.Resolve().EventBus.RaiseLocalEvent(OwnerUid, new RemovedFromPartEvent(old)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartEvent(old)); } else { - IoCManager.Resolve().EventBus.RaiseLocalEvent(OwnerUid, new RemovedFromPartInBodyEvent(old.Body, old)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new RemovedFromPartInBodyEvent(old.Body, old)); } } @@ -49,11 +49,11 @@ namespace Content.Shared.Body.Components { if (value.Body == null) { - IoCManager.Resolve().EventBus.RaiseLocalEvent(OwnerUid, new AddedToPartEvent(value)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartEvent(value)); } else { - IoCManager.Resolve().EventBus.RaiseLocalEvent(OwnerUid, new AddedToPartInBodyEvent(value.Body, value)); + IoCManager.Resolve().EventBus.RaiseLocalEvent(((IComponent) this).Owner, new AddedToPartInBodyEvent(value.Body, value)); } } } diff --git a/Content.Shared/Buckle/SharedBuckleSystem.cs b/Content.Shared/Buckle/SharedBuckleSystem.cs index 86f8724fb4..5bc94119b0 100644 --- a/Content.Shared/Buckle/SharedBuckleSystem.cs +++ b/Content.Shared/Buckle/SharedBuckleSystem.cs @@ -57,7 +57,7 @@ namespace Content.Shared.Buckle private void PreventCollision(EntityUid uid, SharedBuckleComponent component, PreventCollideEvent args) { - if (args.BodyB.OwnerUid != component.LastEntityBuckledTo) return; + if (args.BodyB.Owner != component.LastEntityBuckledTo) return; component.IsOnStrapEntityThisFrame = true; if (component.Buckled || component.DontCollide) diff --git a/Content.Shared/Chemistry/MetabolismMovespeedModifierSystem.cs b/Content.Shared/Chemistry/MetabolismMovespeedModifierSystem.cs index a365d65208..ddf36166ab 100644 --- a/Content.Shared/Chemistry/MetabolismMovespeedModifierSystem.cs +++ b/Content.Shared/Chemistry/MetabolismMovespeedModifierSystem.cs @@ -75,9 +75,9 @@ namespace Content.Shared.Chemistry if (component.ModifierTimer > currentTime) continue; _components.RemoveAt(i); - EntityManager.RemoveComponent(component.OwnerUid); + EntityManager.RemoveComponent(((IComponent) component).Owner); - _movespeed.RefreshMovementSpeedModifiers(component.OwnerUid); + _movespeed.RefreshMovementSpeedModifiers(((IComponent) component).Owner); } } } diff --git a/Content.Shared/Damage/Components/DamageableComponent.cs b/Content.Shared/Damage/Components/DamageableComponent.cs index 74388a6253..72c9e03b5c 100644 --- a/Content.Shared/Damage/Components/DamageableComponent.cs +++ b/Content.Shared/Damage/Components/DamageableComponent.cs @@ -95,7 +95,7 @@ namespace Content.Shared.Damage damage.DamageDict.Add(typeID, damageValue); } - var actual = EntitySystem.Get().TryChangeDamage(OwnerUid, damage); + var actual = EntitySystem.Get().TryChangeDamage(((IComponent) this).Owner, damage); // should logging be disabled during rad storms? a lot of entities are going to be damaged. if (actual != null && !actual.Empty) @@ -120,7 +120,7 @@ namespace Content.Shared.Damage damage.DamageDict.Add(typeID, damageValue); } - var actual = EntitySystem.Get().TryChangeDamage(OwnerUid, damage); + var actual = EntitySystem.Get().TryChangeDamage(((IComponent) this).Owner, damage); // will logging handle nukes? if (actual != null && !actual.Empty) diff --git a/Content.Shared/Damage/Systems/DamageableSystem.cs b/Content.Shared/Damage/Systems/DamageableSystem.cs index 9b21ad702f..74f6730101 100644 --- a/Content.Shared/Damage/Systems/DamageableSystem.cs +++ b/Content.Shared/Damage/Systems/DamageableSystem.cs @@ -128,9 +128,9 @@ namespace Content.Shared.Damage SetTotalDamage(component, component.Damage.Total, logChange); component.Dirty(); - if (EntityManager.TryGetComponent(component.OwnerUid, out var appearance) && damageDelta != null) + if (EntityManager.TryGetComponent(((IComponent) component).Owner, out var appearance) && damageDelta != null) appearance.SetData(DamageVisualizerKeys.DamageUpdateGroups, damageDelta.GetDamagePerGroup().Keys.ToList()); - RaiseLocalEvent(component.OwnerUid, new DamageChangedEvent(component, damageDelta, interruptsDoAfters), false); + RaiseLocalEvent(((IComponent) component).Owner, new DamageChangedEvent(component, damageDelta, interruptsDoAfters), false); } /// diff --git a/Content.Shared/Disposal/SharedDisposalUnitSystem.cs b/Content.Shared/Disposal/SharedDisposalUnitSystem.cs index e2bdb601ea..7ba9d278ad 100644 --- a/Content.Shared/Disposal/SharedDisposalUnitSystem.cs +++ b/Content.Shared/Disposal/SharedDisposalUnitSystem.cs @@ -31,7 +31,7 @@ namespace Content.Shared.Disposal private void HandlePreventCollide(EntityUid uid, SharedDisposalUnitComponent component, PreventCollideEvent args) { - var otherBody = args.BodyB.OwnerUid; + var otherBody = args.BodyB.Owner; // Items dropped shouldn't collide but items thrown should if (EntityManager.HasComponent(otherBody) && diff --git a/Content.Shared/Friction/SharedTileFrictionController.cs b/Content.Shared/Friction/SharedTileFrictionController.cs index ae0bdbb328..14b51d3281 100644 --- a/Content.Shared/Friction/SharedTileFrictionController.cs +++ b/Content.Shared/Friction/SharedTileFrictionController.cs @@ -56,7 +56,7 @@ namespace Content.Shared.Friction if (body.Deleted || prediction && !body.Predict || body.BodyStatus == BodyStatus.InAir || - Mover.UseMobMovement(body.OwnerUid)) continue; + Mover.UseMobMovement(((IComponent) body).Owner)) continue; var surfaceFriction = GetTileFriction(body); var bodyModifier = IoCManager.Resolve().GetComponentOrNull(body.Owner)?.Modifier ?? 1.0f; diff --git a/Content.Shared/Hands/Components/SharedHandsComponent.cs b/Content.Shared/Hands/Components/SharedHandsComponent.cs index df38684ae7..ea81cc76f4 100644 --- a/Content.Shared/Hands/Components/SharedHandsComponent.cs +++ b/Content.Shared/Hands/Components/SharedHandsComponent.cs @@ -432,7 +432,7 @@ namespace Content.Shared.Hands.Components /// private bool PlayerCanDrop() { - if (!IoCManager.Resolve().GetEntitySystem().CanDrop(OwnerUid)) + if (!IoCManager.Resolve().GetEntitySystem().CanDrop(((IComponent) this).Owner)) return false; return true; diff --git a/Content.Shared/MobState/Components/MobStateComponent.cs b/Content.Shared/MobState/Components/MobStateComponent.cs index 35d8a55fd3..ff550d5266 100644 --- a/Content.Shared/MobState/Components/MobStateComponent.cs +++ b/Content.Shared/MobState/Components/MobStateComponent.cs @@ -291,7 +291,7 @@ namespace Content.Shared.MobState.Components { if (!current.HasValue) { - old?.ExitState(OwnerUid, IoCManager.Resolve()); + old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve()); return; } @@ -301,16 +301,16 @@ namespace Content.Shared.MobState.Components if (state == old) { - state.UpdateState(OwnerUid, threshold, IoCManager.Resolve()); + state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve()); return; } - old?.ExitState(OwnerUid, IoCManager.Resolve()); + old?.ExitState(((IComponent) this).Owner, IoCManager.Resolve()); CurrentState = state; - state.EnterState(OwnerUid, IoCManager.Resolve()); - state.UpdateState(OwnerUid, threshold, IoCManager.Resolve()); + state.EnterState(((IComponent) this).Owner, IoCManager.Resolve()); + state.UpdateState(((IComponent) this).Owner, threshold, IoCManager.Resolve()); var message = new MobStateChangedMessage(this, old, state); #pragma warning disable 618 diff --git a/Content.Shared/Movement/EntitySystems/SlowContactsSystem.cs b/Content.Shared/Movement/EntitySystems/SlowContactsSystem.cs index 93c065dec4..8e28e61db6 100644 --- a/Content.Shared/Movement/EntitySystems/SlowContactsSystem.cs +++ b/Content.Shared/Movement/EntitySystems/SlowContactsSystem.cs @@ -36,7 +36,7 @@ public class SlowContactsSystem : EntitySystem foreach (var colliding in _physics.GetCollidingEntities(physicsComponent)) { - var ent = colliding.OwnerUid; + var ent = ((IComponent) colliding).Owner; if (!EntityManager.TryGetComponent(ent, out var slowContactsComponent)) continue; @@ -49,7 +49,7 @@ public class SlowContactsSystem : EntitySystem private void OnEntityExit(EntityUid uid, SlowContactsComponent component, EndCollideEvent args) { - var otherUid = args.OtherFixture.Body.OwnerUid; + var otherUid = ((IComponent) args.OtherFixture.Body).Owner; if (!EntityManager.HasComponent(otherUid) || !EntityManager.HasComponent(otherUid)) return; @@ -64,7 +64,7 @@ public class SlowContactsSystem : EntitySystem private void OnEntityEnter(EntityUid uid, SlowContactsComponent component, StartCollideEvent args) { - var otherUid = args.OtherFixture.Body.OwnerUid; + var otherUid = ((IComponent) args.OtherFixture.Body).Owner; if (!EntityManager.HasComponent(otherUid)) return; if (!_statusCapableInContact.ContainsKey(otherUid)) diff --git a/Content.Shared/Movement/SharedMoverController.cs b/Content.Shared/Movement/SharedMoverController.cs index 66aecf5474..d5dfbc0cfa 100644 --- a/Content.Shared/Movement/SharedMoverController.cs +++ b/Content.Shared/Movement/SharedMoverController.cs @@ -96,15 +96,15 @@ namespace Content.Shared.Movement protected void HandleMobMovement(IMoverComponent mover, PhysicsComponent physicsComponent, IMobMoverComponent mobMover) { - DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.OwnerUid)); + DebugTools.Assert(!UsedMobMovement.ContainsKey(mover.Owner)); if (!UseMobMovement(physicsComponent)) { - UsedMobMovement[mover.OwnerUid] = false; + UsedMobMovement[mover.Owner] = false; return; } - UsedMobMovement[mover.OwnerUid] = true; + UsedMobMovement[mover.Owner] = true; var transform = IoCManager.Resolve().GetComponent(mover.Owner); var weightless = mover.Owner.IsWeightless(physicsComponent, mapManager: _mapManager, entityManager: _entityManager); var (walkDir, sprintDir) = mover.VelocityDir; @@ -167,7 +167,7 @@ namespace Content.Shared.Movement IoCManager.Resolve().HasComponent(body.Owner) && // If we're being pulled then don't mess with our velocity. (!IoCManager.Resolve().TryGetComponent(body.Owner, out SharedPullableComponent? pullable) || !pullable.BeingPulled) && - _blocker.CanMove(body.OwnerUid); + _blocker.CanMove(((IComponent) body).Owner); } /// diff --git a/Content.Shared/Projectiles/ProjectileSystem.cs b/Content.Shared/Projectiles/ProjectileSystem.cs index 227b2a74e0..cb81df02f9 100644 --- a/Content.Shared/Projectiles/ProjectileSystem.cs +++ b/Content.Shared/Projectiles/ProjectileSystem.cs @@ -13,7 +13,7 @@ namespace Content.Shared.Projectiles private void PreventCollision(EntityUid uid, SharedProjectileComponent component, PreventCollideEvent args) { - if (component.IgnoreShooter && args.BodyB.OwnerUid == component.Shooter) + if (component.IgnoreShooter && args.BodyB.Owner == component.Shooter) { args.Cancel(); return; diff --git a/Content.Shared/Pulling/Systems/SharedPullerSystem.cs b/Content.Shared/Pulling/Systems/SharedPullerSystem.cs index 092b9c7d04..e3f59b3d57 100644 --- a/Content.Shared/Pulling/Systems/SharedPullerSystem.cs +++ b/Content.Shared/Pulling/Systems/SharedPullerSystem.cs @@ -45,7 +45,7 @@ namespace Content.Shared.Pulling.Systems SharedPullerComponent component, PullStartedMessage args) { - if (args.Puller.OwnerUid != uid) + if (args.Puller.Owner != uid) return; if (IoCManager.Resolve().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts)) @@ -59,7 +59,7 @@ namespace Content.Shared.Pulling.Systems SharedPullerComponent component, PullStoppedMessage args) { - if (args.Puller.OwnerUid != uid) + if (args.Puller.Owner != uid) return; if (IoCManager.Resolve().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts)) @@ -75,7 +75,7 @@ namespace Content.Shared.Pulling.Systems private void RefreshMovementSpeed(SharedPullerComponent component) { - _movementSpeedModifierSystem.RefreshMovementSpeedModifiers(component.OwnerUid); + _movementSpeedModifierSystem.RefreshMovementSpeedModifiers(((IComponent) component).Owner); } } } diff --git a/Content.Shared/Pulling/Systems/SharedPullingStateManagementSystem.cs b/Content.Shared/Pulling/Systems/SharedPullingStateManagementSystem.cs index 139261a7af..6da2947219 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingStateManagementSystem.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingStateManagementSystem.cs @@ -59,10 +59,10 @@ namespace Content.Shared.Pulling // Messaging var message = new PullStoppedMessage(pullerPhysics, pullablePhysics); - RaiseLocalEvent(puller.OwnerUid, message, broadcast: false); + RaiseLocalEvent(((IComponent) puller).Owner, message, broadcast: false); if ((!IoCManager.Resolve().EntityExists(pullable.Owner) ? EntityLifeStage.Deleted : IoCManager.Resolve().GetComponent(pullable.Owner).EntityLifeStage) <= EntityLifeStage.MapInitialized) - RaiseLocalEvent(pullable.OwnerUid, message); + RaiseLocalEvent(((IComponent) pullable).Owner, message); // Networking puller.Dirty(); @@ -106,7 +106,7 @@ namespace Content.Shared.Pulling var union = pullerPhysics.GetWorldAABB().Union(pullablePhysics.GetWorldAABB()); var length = Math.Max(union.Size.X, union.Size.Y) * 0.75f; - pullable.PullJoint = _jointSystem.CreateDistanceJoint(pullablePhysics.OwnerUid, pullerPhysics.Owner, id:$"pull-joint-{pullablePhysics.Owner}"); + pullable.PullJoint = _jointSystem.CreateDistanceJoint(((IComponent) pullablePhysics).Owner, pullerPhysics.Owner, id:$"pull-joint-{pullablePhysics.Owner}"); pullable.PullJoint.CollideConnected = false; // This maximum has to be there because if the object is constrained too closely, the clamping goes backwards and asserts. pullable.PullJoint.MaxLength = Math.Max(1.0f, length); @@ -117,8 +117,8 @@ namespace Content.Shared.Pulling // Messaging var message = new PullStartedMessage(pullerPhysics, pullablePhysics); - RaiseLocalEvent(puller.OwnerUid, message, broadcast: false); - RaiseLocalEvent(pullable.OwnerUid, message); + RaiseLocalEvent(((IComponent) puller).Owner, message, broadcast: false); + RaiseLocalEvent(((IComponent) pullable).Owner, message); // Networking puller.Dirty(); diff --git a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs index 69ceca0180..dad4b5c16d 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs @@ -92,7 +92,7 @@ namespace Content.Shared.Pulling } var msg = new StopPullingEvent(user); - RaiseLocalEvent(pullable.OwnerUid, msg); + RaiseLocalEvent(((IComponent) pullable).Owner, msg); if (msg.Cancelled) return false; @@ -173,14 +173,14 @@ namespace Content.Shared.Pulling var pullAttempt = new PullAttemptMessage(pullerPhysics, pullablePhysics); - RaiseLocalEvent(puller.OwnerUid, pullAttempt, broadcast: false); + RaiseLocalEvent(((IComponent) puller).Owner, pullAttempt, broadcast: false); if (pullAttempt.Cancelled) { return false; } - RaiseLocalEvent(pullable.OwnerUid, pullAttempt); + RaiseLocalEvent(((IComponent) pullable).Owner, pullAttempt); if (pullAttempt.Cancelled) { diff --git a/Content.Shared/Pulling/Systems/SharedPullingSystem.cs b/Content.Shared/Pulling/Systems/SharedPullingSystem.cs index a9c4844297..cbb5e37701 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingSystem.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingSystem.cs @@ -102,7 +102,7 @@ namespace Content.Shared.Pulling // Raise a "you are being pulled" alert if the pulled entity has alerts. private static void PullableHandlePullStarted(EntityUid uid, SharedPullableComponent component, PullStartedMessage args) { - if (args.Pulled.OwnerUid != uid) + if (args.Pulled.Owner != uid) return; if (IoCManager.Resolve().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts)) @@ -111,7 +111,7 @@ namespace Content.Shared.Pulling private static void PullableHandlePullStopped(EntityUid uid, SharedPullableComponent component, PullStoppedMessage args) { - if (args.Pulled.OwnerUid != uid) + if (args.Pulled.Owner != uid) return; if (IoCManager.Resolve().TryGetComponent(component.Owner, out SharedAlertsComponent? alerts)) diff --git a/Content.Shared/Shuttles/Components/PilotComponent.cs b/Content.Shared/Shuttles/Components/PilotComponent.cs index 91dd68156f..db8a62cbc8 100644 --- a/Content.Shared/Shuttles/Components/PilotComponent.cs +++ b/Content.Shared/Shuttles/Components/PilotComponent.cs @@ -50,7 +50,10 @@ namespace Content.Shared.Shuttles.Components public override ComponentState GetComponentState() { - return new PilotComponentState(Console?.OwnerUid); + if(Console == null) + return new + + return new PilotComponentState(((IComponent) Console).Owner); } [Serializable, NetSerializable] diff --git a/Content.Shared/Slippery/SharedSlipperySystem.cs b/Content.Shared/Slippery/SharedSlipperySystem.cs index 76667d0ba3..fe28ed8706 100644 --- a/Content.Shared/Slippery/SharedSlipperySystem.cs +++ b/Content.Shared/Slippery/SharedSlipperySystem.cs @@ -33,7 +33,7 @@ namespace Content.Shared.Slippery private void HandleCollide(EntityUid uid, SlipperyComponent component, StartCollideEvent args) { - var otherUid = args.OtherFixture.Body.OwnerUid; + var otherUid = ((IComponent) args.OtherFixture.Body).Owner; if (!CanSlip(component, otherUid)) return; @@ -74,7 +74,7 @@ namespace Content.Shared.Slippery private bool TrySlip(SlipperyComponent component, IPhysBody ourBody, IPhysBody otherBody) { - if (!CanSlip(component, otherBody.OwnerUid)) return false; + if (!CanSlip(component, otherBody.Owner)) return false; if (otherBody.LinearVelocity.Length < component.RequiredSlipSpeed) { @@ -89,14 +89,14 @@ namespace Content.Shared.Slippery } var ev = new SlipAttemptEvent(); - RaiseLocalEvent(otherBody.OwnerUid, ev, false); + RaiseLocalEvent(otherBody.Owner, ev, false); if (ev.Cancelled) return false; otherBody.LinearVelocity *= component.LaunchForwardsMultiplier; - _stunSystem.TryParalyze(otherBody.OwnerUid, TimeSpan.FromSeconds(5)); - component.Slipped.Add(otherBody.OwnerUid); + _stunSystem.TryParalyze(otherBody.Owner, TimeSpan.FromSeconds(5)); + component.Slipped.Add(otherBody.Owner); component.Dirty(); PlaySound(component);