diff --git a/Content.Client/Kitchen/Visualizers/MicrowaveVisualizer.cs b/Content.Client/Kitchen/Visualizers/MicrowaveVisualizer.cs index fcebd03e2c..a452dcb729 100644 --- a/Content.Client/Kitchen/Visualizers/MicrowaveVisualizer.cs +++ b/Content.Client/Kitchen/Visualizers/MicrowaveVisualizer.cs @@ -18,7 +18,7 @@ namespace Content.Client.Kitchen.Visualizers base.OnChangeData(component); var sprite = IoCManager.Resolve().GetComponent(component.Owner.Uid); - var microwaveComponent = component.Owner.GetComponentOrNull(); + var microwaveComponent = IoCManager.Resolve().GetComponentOrNull(component.Owner.Uid); if (!component.TryGetData(PowerDeviceVisuals.VisualState, out MicrowaveVisualState state)) { diff --git a/Content.Client/Smoking/BurnStateVisualizer.cs b/Content.Client/Smoking/BurnStateVisualizer.cs index f144eb5b02..387a62091a 100644 --- a/Content.Client/Smoking/BurnStateVisualizer.cs +++ b/Content.Client/Smoking/BurnStateVisualizer.cs @@ -3,6 +3,7 @@ using Content.Shared.Smoking; using JetBrains.Annotations; using Robust.Client.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Client.Smoking @@ -38,7 +39,7 @@ namespace Content.Client.Smoking private void SetState(AppearanceComponent component, SmokableState burnState) { - var clothing = component.Owner.GetComponentOrNull(); + var clothing = IoCManager.Resolve().GetComponentOrNull(component.Owner.Uid); if (component.Owner.TryGetComponent(out var sprite)) { diff --git a/Content.Server/Atmos/Components/GasTankComponent.cs b/Content.Server/Atmos/Components/GasTankComponent.cs index 768702961f..4661b5a9c5 100644 --- a/Content.Server/Atmos/Components/GasTankComponent.cs +++ b/Content.Server/Atmos/Components/GasTankComponent.cs @@ -231,9 +231,9 @@ namespace Content.Server.Atmos.Components private InternalsComponent? GetInternalsComponent(IEntity? owner = null) { if ((!IoCManager.Resolve().EntityExists(Owner.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve().GetComponent(Owner.Uid).EntityLifeStage) >= EntityLifeStage.Deleted) return null; - if (owner != null) return owner.GetComponentOrNull(); + if (owner != null) return IoCManager.Resolve().GetComponentOrNull(owner.Uid); return Owner.TryGetContainer(out var container) - ? container.Owner.GetComponentOrNull() + ? IoCManager.Resolve().GetComponentOrNull(container.Owner.Uid) : null; } diff --git a/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs b/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs index 89ca5022df..aea96c67df 100644 --- a/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs +++ b/Content.Server/Atmos/EntitySystems/BarotraumaSystem.cs @@ -88,7 +88,7 @@ namespace Content.Server.Atmos.EntitySystems var uid = barotrauma.Owner.Uid; - var status = barotrauma.Owner.GetComponentOrNull(); + var status = IoCManager.Resolve().GetComponentOrNull(barotrauma.Owner.Uid); var pressure = 1f; diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasDualPortVentPumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasDualPortVentPumpSystem.cs index b756c09aea..a5e48e8d0d 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasDualPortVentPumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasDualPortVentPumpSystem.cs @@ -28,7 +28,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems private void OnGasDualPortVentPumpUpdated(EntityUid uid, GasDualPortVentPumpComponent vent, AtmosDeviceUpdateEvent args) { - var appearance = vent.Owner.GetComponentOrNull(); + var appearance = IoCManager.Resolve().GetComponentOrNull(vent.Owner.Uid); if (vent.Welded) { diff --git a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs index 89a6fb0c21..29a9d1c005 100644 --- a/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs +++ b/Content.Server/Atmos/Piping/Binary/EntitySystems/GasPressurePumpSystem.cs @@ -50,7 +50,7 @@ namespace Content.Server.Atmos.Piping.Binary.EntitySystems private void OnPumpUpdated(EntityUid uid, GasPressurePumpComponent pump, AtmosDeviceUpdateEvent args) { - var appearance = pump.Owner.GetComponentOrNull(); + var appearance = IoCManager.Resolve().GetComponentOrNull(pump.Owner.Uid); if (!pump.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer) diff --git a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs index 3b2017e0f1..5187743b6e 100644 --- a/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs +++ b/Content.Server/Atmos/Piping/Trinary/EntitySystems/GasFilterSystem.cs @@ -38,7 +38,7 @@ namespace Content.Server.Atmos.Piping.Trinary.EntitySystems private void OnFilterUpdated(EntityUid uid, GasFilterComponent filter, AtmosDeviceUpdateEvent args) { - var appearance = filter.Owner.GetComponentOrNull(); + var appearance = IoCManager.Resolve().GetComponentOrNull(filter.Owner.Uid); if (!filter.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer) diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs index 2eef750ef9..be39e37991 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasThermoMachineSystem.cs @@ -25,7 +25,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems private void OnThermoMachineUpdated(EntityUid uid, GasThermoMachineComponent thermoMachine, AtmosDeviceUpdateEvent args) { - var appearance = thermoMachine.Owner.GetComponentOrNull(); + var appearance = IoCManager.Resolve().GetComponentOrNull(thermoMachine.Owner.Uid); if (!thermoMachine.Enabled || !EntityManager.TryGetComponent(uid, out NodeContainerComponent? nodeContainer) diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs index 4afbe0e9a6..121a33b24f 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentPumpSystem.cs @@ -27,7 +27,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems private void OnGasVentPumpUpdated(EntityUid uid, GasVentPumpComponent vent, AtmosDeviceUpdateEvent args) { - var appearance = vent.Owner.GetComponentOrNull(); + var appearance = IoCManager.Resolve().GetComponentOrNull(vent.Owner.Uid); if (vent.Welded) { diff --git a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs index 85ff881b7f..5b184f4bb5 100644 --- a/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs +++ b/Content.Server/Atmos/Piping/Unary/EntitySystems/GasVentScrubberSystem.cs @@ -28,7 +28,7 @@ namespace Content.Server.Atmos.Piping.Unary.EntitySystems private void OnVentScrubberUpdated(EntityUid uid, GasVentScrubberComponent scrubber, AtmosDeviceUpdateEvent args) { - var appearance = scrubber.Owner.GetComponentOrNull(); + var appearance = IoCManager.Resolve().GetComponentOrNull(scrubber.Owner.Uid); if (scrubber.Welded) { diff --git a/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs b/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs index ac1f96254a..025fead820 100644 --- a/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs +++ b/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs @@ -31,7 +31,7 @@ namespace Content.Server.Body.Surgery private bool VesselsClamped { get; set; } - public SharedBodyPartComponent? Parent => Owner.GetComponentOrNull(); + public SharedBodyPartComponent? Parent => IoCManager.Resolve().GetComponentOrNull(Owner.Uid); public BodyPartType? ParentType => Parent?.PartType; diff --git a/Content.Server/Chemistry/ReactionEffects/FoamAreaReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/FoamAreaReactionEffect.cs index 76f250dced..d090f0b637 100644 --- a/Content.Server/Chemistry/ReactionEffects/FoamAreaReactionEffect.cs +++ b/Content.Server/Chemistry/ReactionEffects/FoamAreaReactionEffect.cs @@ -1,6 +1,7 @@ using Content.Server.Chemistry.Components; using JetBrains.Annotations; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.Chemistry.ReactionEffects @@ -11,7 +12,7 @@ namespace Content.Server.Chemistry.ReactionEffects { protected override SolutionAreaEffectComponent? GetAreaEffectComponent(IEntity entity) { - return entity.GetComponentOrNull(); + return IoCManager.Resolve().GetComponentOrNull(entity.Uid); } } } diff --git a/Content.Server/Chemistry/ReactionEffects/SmokeAreaReactionEffect.cs b/Content.Server/Chemistry/ReactionEffects/SmokeAreaReactionEffect.cs index 08032d183e..47f5a489d8 100644 --- a/Content.Server/Chemistry/ReactionEffects/SmokeAreaReactionEffect.cs +++ b/Content.Server/Chemistry/ReactionEffects/SmokeAreaReactionEffect.cs @@ -1,6 +1,7 @@ using Content.Server.Chemistry.Components; using JetBrains.Annotations; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization.Manager.Attributes; namespace Content.Server.Chemistry.ReactionEffects @@ -11,7 +12,7 @@ namespace Content.Server.Chemistry.ReactionEffects { protected override SolutionAreaEffectComponent? GetAreaEffectComponent(IEntity entity) { - return entity.GetComponentOrNull(); + return IoCManager.Resolve().GetComponentOrNull(entity.Uid); } } } diff --git a/Content.Server/Cuffs/CuffableSystem.cs b/Content.Server/Cuffs/CuffableSystem.cs index 2ec1a213bd..837206a7fd 100644 --- a/Content.Server/Cuffs/CuffableSystem.cs +++ b/Content.Server/Cuffs/CuffableSystem.cs @@ -105,7 +105,7 @@ namespace Content.Server.Cuffs !cuffable.Initialized) return; var dirty = false; - var handCount = owner.GetComponentOrNull()?.Count ?? 0; + var handCount = IoCManager.Resolve().GetComponentOrNull(owner.Uid)?.Count ?? 0; while (cuffable.CuffedHandCount > handCount && cuffable.CuffedHandCount > 0) { diff --git a/Content.Server/Instruments/InstrumentComponent.cs b/Content.Server/Instruments/InstrumentComponent.cs index 67e1b0f3c3..611f671da8 100644 --- a/Content.Server/Instruments/InstrumentComponent.cs +++ b/Content.Server/Instruments/InstrumentComponent.cs @@ -3,6 +3,7 @@ using Content.Shared.Instruments; using Robust.Server.GameObjects; using Robust.Server.Player; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.ViewVariables; namespace Content.Server.Instruments; @@ -23,8 +24,8 @@ public sealed class InstrumentComponent : SharedInstrumentComponent public int MidiEventCount = 0; public IPlayerSession? InstrumentPlayer => - Owner.GetComponentOrNull()?.CurrentSingleUser - ?? Owner.GetComponentOrNull()?.PlayerSession; + IoCManager.Resolve().GetComponentOrNull(Owner.Uid)?.CurrentSingleUser + ?? IoCManager.Resolve().GetComponentOrNull(Owner.Uid)?.PlayerSession; [ViewVariables] public BoundUserInterface? UserInterface => Owner.GetUIOrNull(InstrumentUiKey.Key); } diff --git a/Content.Server/Inventory/Components/InventoryComponent.cs b/Content.Server/Inventory/Components/InventoryComponent.cs index 2559a40cc4..ba186bec6a 100644 --- a/Content.Server/Inventory/Components/InventoryComponent.cs +++ b/Content.Server/Inventory/Components/InventoryComponent.cs @@ -112,7 +112,7 @@ namespace Content.Server.Inventory.Components public IEnumerable LookupItems() where T : Component { return _slotContainers.Values - .SelectMany(x => x.ContainedEntities.Select(e => e.GetComponentOrNull())) + .SelectMany(x => x.ContainedEntities.Select(e => IoCManager.Resolve().GetComponentOrNull(e.Uid))) .Where(x => x != null); } diff --git a/Content.Server/Light/EntitySystems/LightReplacerSystem.cs b/Content.Server/Light/EntitySystems/LightReplacerSystem.cs index 17e88d7b75..657bd2aff8 100644 --- a/Content.Server/Light/EntitySystems/LightReplacerSystem.cs +++ b/Content.Server/Light/EntitySystems/LightReplacerSystem.cs @@ -107,7 +107,7 @@ namespace Content.Server.Light.EntitySystems // try get first inserted bulb of the same type as targeted light fixtutre var bulb = replacer.InsertedBulbs.ContainedEntities.FirstOrDefault( - (e) => e.GetComponentOrNull()?.Type == fixture.BulbType); + (e) => IoCManager.Resolve().GetComponentOrNull(e.Uid)?.Type == fixture.BulbType); // found bulb in inserted storage if (bulb != null) diff --git a/Content.Server/Medical/Components/MedicalScannerComponent.cs b/Content.Server/Medical/Components/MedicalScannerComponent.cs index 1b5ab9859d..ad654e95d2 100644 --- a/Content.Server/Medical/Components/MedicalScannerComponent.cs +++ b/Content.Server/Medical/Components/MedicalScannerComponent.cs @@ -137,7 +137,7 @@ namespace Content.Server.Medical.Components if (body == null) return MedicalScannerStatus.Open; - var state = body.GetComponentOrNull(); + var state = IoCManager.Resolve().GetComponentOrNull(body.Uid); return state == null ? MedicalScannerStatus.Open : GetStatusFromDamageState(state); } diff --git a/Content.Server/Mind/Mind.cs b/Content.Server/Mind/Mind.cs index cdef9db3ab..045b444fed 100644 --- a/Content.Server/Mind/Mind.cs +++ b/Content.Server/Mind/Mind.cs @@ -155,7 +155,7 @@ namespace Content.Server.Mind // This can be null if they're deleted (spike / brain nom) if (OwnedEntity == null) return true; - var targetMobState = OwnedEntity.GetComponentOrNull(); + var targetMobState = IoCManager.Resolve().GetComponentOrNull(OwnedEntity.Uid); // This can be null if it's a brain (this happens very often) // Brains are the result of gibbing so should definitely count as dead if (targetMobState == null) diff --git a/Content.Server/Objectives/Conditions/KillRandomPersonCondition.cs b/Content.Server/Objectives/Conditions/KillRandomPersonCondition.cs index 1a47af4bbc..82b14312a0 100644 --- a/Content.Server/Objectives/Conditions/KillRandomPersonCondition.cs +++ b/Content.Server/Objectives/Conditions/KillRandomPersonCondition.cs @@ -20,7 +20,11 @@ namespace Content.Server.Objectives.Conditions var allHumans = entityMgr.EntityQuery(true).Where(mc => { var entity = mc.Mind?.OwnedEntity; - return (entity?.GetComponentOrNull()?.IsAlive() ?? false) && mc.Mind != mind; + + if (entity == null) + return false; + + return (IoCManager.Resolve().GetComponentOrNull(entity.Uid)?.IsAlive() ?? false) && mc.Mind != mind; }).Select(mc => mc.Mind).ToList(); return new KillRandomPersonCondition {Target = IoCManager.Resolve().Pick(allHumans)}; } diff --git a/Content.Server/PDA/PDASystem.cs b/Content.Server/PDA/PDASystem.cs index 81a9f9ffe1..db82a58cc9 100644 --- a/Content.Server/PDA/PDASystem.cs +++ b/Content.Server/PDA/PDASystem.cs @@ -73,7 +73,7 @@ namespace Content.Server.PDA private void OnItemInserted(EntityUid uid, PDAComponent pda, EntInsertedIntoContainerMessage args) { if (args.Container.ID == pda.IdSlot.ID) - pda.ContainedID = args.Entity.GetComponentOrNull(); + pda.ContainedID = IoCManager.Resolve().GetComponentOrNull(args.Entity.Uid); UpdatePDAAppearance(pda); UpdatePDAUserInterface(pda); diff --git a/Content.Server/Storage/EntitySystems/StorageSystem.cs b/Content.Server/Storage/EntitySystems/StorageSystem.cs index ed817456ef..5cf6850391 100644 --- a/Content.Server/Storage/EntitySystems/StorageSystem.cs +++ b/Content.Server/Storage/EntitySystems/StorageSystem.cs @@ -91,7 +91,7 @@ namespace Content.Server.Storage.EntitySystems return; // Get the session for the user - var session = args.User.GetComponentOrNull()?.PlayerSession; + var session = IoCManager.Resolve().GetComponentOrNull(args.User.Uid)?.PlayerSession; if (session == null) return; diff --git a/Content.Server/UserInterface/UserInterfaceHelpers.cs b/Content.Server/UserInterface/UserInterfaceHelpers.cs index 5072da1586..e12ddcd66a 100644 --- a/Content.Server/UserInterface/UserInterfaceHelpers.cs +++ b/Content.Server/UserInterface/UserInterfaceHelpers.cs @@ -1,5 +1,6 @@ using Robust.Server.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.UserInterface { @@ -7,7 +8,7 @@ namespace Content.Server.UserInterface { public static BoundUserInterface? GetUIOrNull(this IEntity entity, object uiKey) { - return entity.GetComponentOrNull()?.GetBoundUserInterfaceOrNull(uiKey); + return IoCManager.Resolve().GetComponentOrNull(entity.Uid)?.GetBoundUserInterfaceOrNull(uiKey); } } } diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs index 7acaeab14e..5ab89867b6 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/BoltActionBarrelComponent.cs @@ -192,7 +192,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (chamberEntity == null) return null; - return chamberEntity.GetComponentOrNull()?.TakeBullet(spawnAt); + return IoCManager.Resolve().GetComponentOrNull(chamberEntity.Uid)?.TakeBullet(spawnAt); } protected override bool WeaponCanFire() diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs index 8f825e2a72..5f1f94d71f 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/PumpBarrelComponent.cs @@ -149,6 +149,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components public override IEntity? TakeProjectile(EntityCoordinates spawnAt) { var chamberEntity = _chamberContainer.ContainedEntity; + if (!_manualCycle) { Cycle(); @@ -158,7 +159,10 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components Dirty(); } - return chamberEntity?.GetComponentOrNull()?.TakeBullet(spawnAt); + if (chamberEntity == null) + return null; + + return IoCManager.Resolve().GetComponentOrNull(chamberEntity.Uid)?.TakeBullet(spawnAt); } private void Cycle(bool manual = false) diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs index 97bac668e9..1d99526b6d 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs @@ -36,7 +36,17 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components [ViewVariables] private string? _ammoPrototype; [ViewVariables] public IEntity? PowerCellEntity => _powerCellContainer.ContainedEntity; - public BatteryComponent? PowerCell => _powerCellContainer.ContainedEntity?.GetComponentOrNull(); + public BatteryComponent? PowerCell + { + get + { + if (_powerCellContainer.ContainedEntity == null) + return null; + + return _powerCellContainer.ContainedEntity.GetComponentOrNull(); + } + } + private ContainerSlot _powerCellContainer = default!; private ContainerSlot _ammoContainer = default!; [DataField("powerCellPrototype")] diff --git a/Content.Shared/Body/Components/SharedBodyPartComponent.cs b/Content.Shared/Body/Components/SharedBodyPartComponent.cs index 15ed11df17..604f3186c0 100644 --- a/Content.Shared/Body/Components/SharedBodyPartComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyPartComponent.cs @@ -110,7 +110,7 @@ namespace Content.Shared.Body.Components public BodyPartSymmetry Symmetry { get; private set; } = BodyPartSymmetry.None; [ViewVariables] - public ISurgeryData? SurgeryDataComponent => Owner.GetComponentOrNull(); + public ISurgeryData? SurgeryDataComponent => IoCManager.Resolve().GetComponentOrNull(Owner.Uid); protected virtual void OnAddMechanism(SharedMechanismComponent mechanism) { diff --git a/Content.Shared/Friction/SharedTileFrictionController.cs b/Content.Shared/Friction/SharedTileFrictionController.cs index 53ea89a7d2..aedb672832 100644 --- a/Content.Shared/Friction/SharedTileFrictionController.cs +++ b/Content.Shared/Friction/SharedTileFrictionController.cs @@ -59,7 +59,7 @@ namespace Content.Shared.Friction Mover.UseMobMovement(body.OwnerUid)) continue; var surfaceFriction = GetTileFriction(body); - var bodyModifier = body.Owner.GetComponentOrNull()?.Modifier ?? 1.0f; + var bodyModifier = IoCManager.Resolve().GetComponentOrNull(body.Owner.Uid)?.Modifier ?? 1.0f; var friction = _frictionModifier * surfaceFriction * bodyModifier; ReduceLinearVelocity(prediction, body, friction, frameTime); diff --git a/Content.Shared/MobState/Components/MobStateComponent.cs b/Content.Shared/MobState/Components/MobStateComponent.cs index 14b6349b13..0edcbc4c69 100644 --- a/Content.Shared/MobState/Components/MobStateComponent.cs +++ b/Content.Shared/MobState/Components/MobStateComponent.cs @@ -60,7 +60,7 @@ namespace Content.Shared.MobState.Components else { // Initialize with some amount of damage, defaulting to 0. - UpdateState(Owner.GetComponentOrNull()?.TotalDamage ?? FixedPoint2.Zero); + UpdateState(IoCManager.Resolve().GetComponentOrNull(Owner.Uid)?.TotalDamage ?? FixedPoint2.Zero); } } diff --git a/Content.Shared/Singularity/SharedSingularitySystem.cs b/Content.Shared/Singularity/SharedSingularitySystem.cs index 6b45613c4b..67991e18ec 100644 --- a/Content.Shared/Singularity/SharedSingularitySystem.cs +++ b/Content.Shared/Singularity/SharedSingularitySystem.cs @@ -55,7 +55,7 @@ namespace Content.Shared.Singularity value = Math.Clamp(value, 0, 6); - var physics = singularity.Owner.GetComponentOrNull(); + var physics = IoCManager.Resolve().GetComponentOrNull(singularity.Owner.Uid); if (singularity.Level > 1 && value <= 1) {