diff --git a/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs b/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs index ac27c209b4..3457142e88 100644 --- a/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs +++ b/Content.Server/GameObjects/Components/Access/IdCardConsoleComponent.cs @@ -45,16 +45,10 @@ namespace Content.Server.GameObjects.Components.Access _privilegedIdContainer = ContainerManagerComponent.Ensure($"{Name}-privilegedId", Owner); _targetIdContainer = ContainerManagerComponent.Ensure($"{Name}-targetId", Owner); - if (!Owner.EnsureComponent(out AccessReader _)) - { - Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} didn't have a {nameof(AccessReader)}"); - } + Owner.EnsureComponentWarn(); + Owner.EnsureComponentWarn(); - if (UserInterface == null) - { - Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} doesn't have a {nameof(ServerUserInterfaceComponent)}"); - } - else + if (UserInterface != null) { UserInterface.OnReceiveMessage += OnUiReceiveMessage; } diff --git a/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs b/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs index 03f9c7f8cc..f87212e0cc 100644 --- a/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs +++ b/Content.Server/GameObjects/Components/Atmos/AirtightComponent.cs @@ -1,15 +1,10 @@ #nullable enable -using System; using Content.Server.GameObjects.EntitySystems; using Content.Shared.Atmos; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components.Transform; using Robust.Shared.GameObjects.Systems; -using Robust.Shared.Interfaces.GameObjects; -using Robust.Shared.Interfaces.Map; -using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization; @@ -85,10 +80,9 @@ namespace Content.Server.GameObjects.Components.Atmos // Using the SnapGrid is critical for performance, and thus if it is absent the component // will not be airtight. A warning is much easier to track down than the object magically // not being airtight, so log one if the SnapGrid component is missing. - if (!Owner.EnsureComponent(out SnapGridComponent _)) - Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} didn't have a {nameof(SnapGridComponent)}"); + Owner.EnsureComponentWarn(out SnapGridComponent _); - if(_fixAirBlockedDirectionInitialize) + if (_fixAirBlockedDirectionInitialize) RotateEvent(new RotateEvent(Owner, Angle.Zero, Owner.Transform.LocalRotation)); UpdatePosition(); diff --git a/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs b/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs index 54082b4599..0f1dd177c7 100644 --- a/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs +++ b/Content.Server/GameObjects/Components/Body/Behavior/StomachBehavior.cs @@ -6,7 +6,6 @@ using Content.Shared.Chemistry; using Content.Shared.GameObjects.Components.Body.Networks; using Content.Shared.GameObjects.Components.Chemistry; using Robust.Shared.GameObjects; -using Robust.Shared.Log; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -116,10 +115,7 @@ namespace Content.Server.GameObjects.Components.Body.Behavior { base.Startup(); - if (!Owner.EnsureComponent(out SolutionContainerComponent solution)) - { - Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} didn't have a {nameof(SolutionContainerComponent)}"); - } + Owner.EnsureComponentWarn(out SolutionContainerComponent solution); solution.MaxVolume = InitialMaxVolume; } diff --git a/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs b/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs index 6eb4b53203..9ff7e3394c 100644 --- a/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs +++ b/Content.Server/GameObjects/Components/Body/BodyScannerComponent.cs @@ -6,7 +6,6 @@ using Content.Shared.Interfaces.GameObjects.Components; using Robust.Server.GameObjects.Components.UserInterface; using Robust.Server.Interfaces.GameObjects; using Robust.Shared.GameObjects; -using Robust.Shared.Log; using Robust.Shared.ViewVariables; namespace Content.Server.GameObjects.Components.Body @@ -45,11 +44,9 @@ namespace Content.Server.GameObjects.Components.Body { base.Initialize(); - if (UserInterface == null) - { - Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} doesn't have a {nameof(ServerUserInterfaceComponent)}"); - } - else + Owner.EnsureComponentWarn(); + + if (UserInterface != null) { UserInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage; } diff --git a/Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs b/Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs index 2c1eb99033..e1a520a351 100644 --- a/Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs +++ b/Content.Server/GameObjects/Components/Botany/PlantHolderComponent.cs @@ -26,7 +26,6 @@ using Robust.Shared.Interfaces.Random; using Robust.Shared.Interfaces.Timing; using Robust.Shared.IoC; using Robust.Shared.Localization; -using Robust.Shared.Log; using Robust.Shared.Maths; using Robust.Shared.Prototypes; using Robust.Shared.Random; @@ -124,8 +123,7 @@ namespace Content.Server.GameObjects.Components.Botany { base.Initialize(); - if(!Owner.EnsureComponent(out var solution)) - Logger.Warning($"Entity {Owner} with a PlantHolderComponent did not have a SolutionContainerComponent."); + Owner.EnsureComponentWarn(); } public override void ExposeData(ObjectSerializer serializer) diff --git a/Content.Server/GameObjects/Components/Botany/ProduceComponent.cs b/Content.Server/GameObjects/Components/Botany/ProduceComponent.cs index 0e5ca425dc..cd6e2b6eaf 100644 --- a/Content.Server/GameObjects/Components/Botany/ProduceComponent.cs +++ b/Content.Server/GameObjects/Components/Botany/ProduceComponent.cs @@ -3,7 +3,6 @@ using Content.Server.GameObjects.Components.Chemistry; using Content.Shared.Chemistry; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; -using Robust.Shared.Interfaces.Random; using Robust.Shared.IoC; using Robust.Shared.Maths; using Robust.Shared.Prototypes; diff --git a/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs b/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs index 6e167e2a62..35c9577c7a 100644 --- a/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs +++ b/Content.Server/GameObjects/Components/Cargo/CargoConsoleComponent.cs @@ -66,15 +66,8 @@ namespace Content.Server.GameObjects.Components.Cargo { base.Initialize(); - if (!Owner.EnsureComponent(out GalacticMarketComponent _)) - { - Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} had no {nameof(GalacticMarketComponent)}"); - } - - if (!Owner.EnsureComponent(out CargoOrderDatabaseComponent _)) - { - Logger.Warning($"Entity {Owner} at {Owner.Transform.MapPosition} had no {nameof(GalacticMarketComponent)}"); - } + Owner.EnsureComponentWarn(out GalacticMarketComponent _); + Owner.EnsureComponentWarn(out CargoOrderDatabaseComponent _); if (UserInterface != null) { diff --git a/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs b/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs index b6b7f1ea26..d8d071ddff 100644 --- a/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/PillComponent.cs @@ -4,7 +4,6 @@ using Content.Server.GameObjects.Components.Nutrition; using Content.Server.GameObjects.Components.Utensil; using Content.Shared.Chemistry; using Content.Shared.GameObjects.Components.Body; -using Content.Shared.GameObjects.Components.Body.Mechanism; using Content.Shared.Interfaces; using Content.Shared.Interfaces.GameObjects.Components; using Content.Shared.Utility; @@ -14,7 +13,6 @@ using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.IoC; using Robust.Shared.Localization; -using Robust.Shared.Log; using Robust.Shared.Prototypes; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -52,10 +50,7 @@ namespace Content.Server.GameObjects.Components.Chemistry { base.Initialize(); - if (!Owner.EnsureComponent(out _contents)) - { - Logger.Error($"Prototype {Owner.Prototype?.ID} had a {nameof(PillComponent)} without a {nameof(SolutionContainerComponent)}!"); - } + Owner.EnsureComponentWarn(out _contents); } bool IUse.UseEntity(UseEntityEventArgs eventArgs) diff --git a/Content.Server/GameObjects/Components/Chemistry/TransformableContainerComponent.cs b/Content.Server/GameObjects/Components/Chemistry/TransformableContainerComponent.cs index 1768c74936..fb9f105792 100644 --- a/Content.Server/GameObjects/Components/Chemistry/TransformableContainerComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/TransformableContainerComponent.cs @@ -4,7 +4,6 @@ using Content.Shared.Chemistry; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Prototypes; using Robust.Shared.Utility; @@ -42,11 +41,7 @@ namespace Content.Server.GameObjects.Components.Chemistry { base.Startup(); - if (!Owner.EnsureComponent(out SolutionContainerComponent solution)) - { - Logger.Warning( - $"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(SolutionContainerComponent)}"); - } + Owner.EnsureComponentWarn(out SolutionContainerComponent solution); solution.Capabilities |= SolutionContainerCaps.FitsInDispenser; } diff --git a/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs b/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs index 0b2e945f2e..44461c3b94 100644 --- a/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/VaporComponent.cs @@ -1,16 +1,13 @@ using System.Linq; -using Content.Server.GameObjects.Components.Fluids; using Content.Shared.Chemistry; using Content.Shared.GameObjects.Components; using Content.Shared.Interfaces.GameObjects.Components; using Content.Shared.Physics; -using Microsoft.DiaSymReader; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Components; using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Map; using Robust.Shared.IoC; -using Robust.Shared.Log; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Prototypes; @@ -43,11 +40,7 @@ namespace Content.Server.GameObjects.Components.Chemistry { base.Initialize(); - if (!Owner.EnsureComponent(out SolutionContainerComponent _)) - { - Logger.Warning( - $"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(SolutionContainerComponent)}"); - } + Owner.EnsureComponentWarn(out SolutionContainerComponent _); } public void Start(Vector2 dir, float velocity, EntityCoordinates target, float aliveTime) diff --git a/Content.Server/GameObjects/Components/Fluids/BucketComponent.cs b/Content.Server/GameObjects/Components/Fluids/BucketComponent.cs index 05d67a3356..60f52f3fc0 100644 --- a/Content.Server/GameObjects/Components/Fluids/BucketComponent.cs +++ b/Content.Server/GameObjects/Components/Fluids/BucketComponent.cs @@ -49,7 +49,7 @@ namespace Content.Server.GameObjects.Components.Fluids public override void Initialize() { base.Initialize(); - Owner.EnsureComponent(); + Owner.EnsureComponentWarn(); } private bool TryGiveToMop(MopComponent mopComponent) diff --git a/Content.Server/GameObjects/Components/Fluids/MopComponent.cs b/Content.Server/GameObjects/Components/Fluids/MopComponent.cs index 4f98e213db..47260bb4d8 100644 --- a/Content.Server/GameObjects/Components/Fluids/MopComponent.cs +++ b/Content.Server/GameObjects/Components/Fluids/MopComponent.cs @@ -8,7 +8,6 @@ using Robust.Server.GameObjects.EntitySystems; using Robust.Shared.GameObjects; using Robust.Shared.GameObjects.Systems; using Robust.Shared.Localization; -using Robust.Shared.Log; using Robust.Shared.Serialization; namespace Content.Server.GameObjects.Components.Fluids @@ -59,10 +58,7 @@ namespace Content.Server.GameObjects.Components.Fluids { base.Initialize(); - if (!Owner.EnsureComponent(out SolutionContainerComponent _)) - { - Logger.Warning($"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(SolutionContainerComponent)}"); - } + Owner.EnsureComponentWarn(out SolutionContainerComponent _); } void IAfterInteract.AfterInteract(AfterInteractEventArgs eventArgs) diff --git a/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs b/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs index 9e91be5b32..0a3de896c6 100644 --- a/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs +++ b/Content.Server/GameObjects/Components/Fluids/PuddleComponent.cs @@ -17,7 +17,6 @@ using Robust.Shared.GameObjects.Components; using Robust.Shared.GameObjects.Components.Timers; using Robust.Shared.GameObjects.Components.Transform; using Robust.Shared.GameObjects.Systems; -using Robust.Shared.Interfaces.GameObjects; using Robust.Shared.Interfaces.Map; using Robust.Shared.Interfaces.Random; using Robust.Shared.IoC; @@ -26,7 +25,6 @@ using Robust.Shared.Maths; using Robust.Shared.Serialization; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; -using Timer = Robust.Shared.Timers.Timer; namespace Content.Server.GameObjects.Components.Fluids { diff --git a/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs b/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs index 6669a8b261..1e90818ece 100644 --- a/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs +++ b/Content.Server/GameObjects/Components/Fluids/SprayComponent.cs @@ -75,11 +75,7 @@ namespace Content.Server.GameObjects.Components.Fluids { base.Initialize(); - if (!Owner.EnsureComponent(out SolutionContainerComponent _)) - { - Logger.Warning( - $"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(SolutionContainerComponent)}"); - } + Owner.EnsureComponentWarn(out SolutionContainerComponent _); if (_hasSafety) { diff --git a/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs b/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs index fa4f3969b6..ff755d3cdd 100644 --- a/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs +++ b/Content.Server/GameObjects/Components/GUI/StrippableComponent.cs @@ -39,14 +39,15 @@ namespace Content.Server.GameObjects.Components.GUI UserInterface.OnReceiveMessage += HandleUserInterfaceMessage; } - Owner.EnsureComponent(); - Owner.EnsureComponent(); - Owner.EnsureComponent(); + Owner.EnsureComponentWarn(); + Owner.EnsureComponentWarn(); + Owner.EnsureComponentWarn(); if (Owner.TryGetComponent(out CuffableComponent? cuffed)) { cuffed.OnCuffedStateChanged += UpdateSubscribed; } + if (Owner.TryGetComponent(out InventoryComponent? inventory)) { inventory.OnItemChanged += UpdateSubscribed; diff --git a/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs b/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs index cfda030efd..efdb161935 100644 --- a/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs +++ b/Content.Server/GameObjects/Components/Movement/ClimbableComponent.cs @@ -46,10 +46,7 @@ namespace Content.Server.GameObjects.Components.Movement { base.Initialize(); - if (!Owner.EnsureComponent(out PhysicsComponent _)) - { - Logger.Warning($"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(PhysicsComponent)}"); - } + Owner.EnsureComponentWarn(out PhysicsComponent _); _doAfterSystem = EntitySystem.Get(); } diff --git a/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs b/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs index a71ff53d02..071866c0df 100644 --- a/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs +++ b/Content.Server/GameObjects/Components/Nutrition/FoodComponent.cs @@ -88,7 +88,7 @@ namespace Content.Server.GameObjects.Components.Nutrition public override void Initialize() { base.Initialize(); - Owner.EnsureComponent(); + Owner.EnsureComponentWarn(); } bool IUse.UseEntity(UseEntityEventArgs eventArgs) diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/ApcComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/ApcComponent.cs index fdb9d14133..ceac693a91 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/ApcComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/ApcComponent.cs @@ -56,6 +56,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents Owner.EnsureComponent(); Owner.EnsureComponent(); + Owner.EnsureComponentWarn(); if (UserInterface != null) { diff --git a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs index 0bc9c83bba..d52173e7d2 100644 --- a/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs +++ b/Content.Server/GameObjects/Components/Power/ApcNetComponents/PowerReceiverUsers/EmergencyLightComponent.cs @@ -3,9 +3,7 @@ using System.Collections.Generic; using Content.Shared.GameObjects.EntitySystems; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; -using Robust.Shared.GameObjects.Systems; using Robust.Shared.Localization; -using Robust.Shared.Log; using Robust.Shared.Serialization; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; @@ -142,10 +140,7 @@ namespace Content.Server.GameObjects.Components.Power.ApcNetComponents.PowerRece { base.Initialize(); - if (!Owner.EnsureComponent(out PowerReceiverComponent receiver)) - { - Logger.Warning($"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(PowerReceiverComponent)}"); - } + Owner.EnsureComponentWarn(out PowerReceiverComponent receiver); receiver.OnPowerStateChanged += UpdateState; State = EmergencyLightState.Charging; diff --git a/Content.Server/GameObjects/Components/Power/PowerNetComponents/SmesComponent.cs b/Content.Server/GameObjects/Components/Power/PowerNetComponents/SmesComponent.cs index 3cacb3ad86..bc7829a9a6 100644 --- a/Content.Server/GameObjects/Components/Power/PowerNetComponents/SmesComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerNetComponents/SmesComponent.cs @@ -36,7 +36,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents base.Initialize(); Owner.EnsureComponent(); - Owner.EnsureComponent(); + Owner.EnsureComponentWarn(); } public void OnUpdate() diff --git a/Content.Server/GameObjects/Components/Power/PowerNetComponents/SolarPanelComponent.cs b/Content.Server/GameObjects/Components/Power/PowerNetComponents/SolarPanelComponent.cs index fc79c97485..6a3f46efcc 100644 --- a/Content.Server/GameObjects/Components/Power/PowerNetComponents/SolarPanelComponent.cs +++ b/Content.Server/GameObjects/Components/Power/PowerNetComponents/SolarPanelComponent.cs @@ -4,7 +4,6 @@ using Content.Shared.GameObjects.EntitySystems; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; using Robust.Shared.Interfaces.Timing; -using Robust.Shared.Log; using Robust.Shared.Serialization; using Robust.Shared.ViewVariables; @@ -73,10 +72,7 @@ namespace Content.Server.GameObjects.Components.Power.PowerNetComponents { base.Initialize(); - if (!Owner.EnsureComponent(out PowerSupplierComponent _)) - { - Logger.Warning($"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(PowerSupplierComponent)}"); - } + Owner.EnsureComponentWarn(out PowerSupplierComponent _); UpdateSupply(); } diff --git a/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs b/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs index 95ab0b07ee..7c4c078208 100644 --- a/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs +++ b/Content.Server/GameObjects/Components/Projectiles/StunnableProjectileComponent.cs @@ -32,11 +32,7 @@ namespace Content.Server.GameObjects.Components.Projectiles { base.Initialize(); - if (!Owner.EnsureComponent(out ProjectileComponent _)) - { - Logger.Warning( - $"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(ProjectileComponent)}"); - } + Owner.EnsureComponentWarn(out ProjectileComponent _); } void ICollideBehavior.CollideWith(IEntity entity) diff --git a/Content.Server/GameObjects/Components/Research/ResearchConsoleComponent.cs b/Content.Server/GameObjects/Components/Research/ResearchConsoleComponent.cs index 81c66ad99f..07bcdab005 100644 --- a/Content.Server/GameObjects/Components/Research/ResearchConsoleComponent.cs +++ b/Content.Server/GameObjects/Components/Research/ResearchConsoleComponent.cs @@ -37,6 +37,8 @@ namespace Content.Server.GameObjects.Components.Research { base.Initialize(); + Owner.EnsureComponentWarn(); + if (UserInterface != null) { UserInterface.OnReceiveMessage += UserInterfaceOnOnReceiveMessage; diff --git a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs index e858cd9f82..b76bbb801f 100644 --- a/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs +++ b/Content.Server/GameObjects/Components/Weapon/Ranged/Barrels/ServerRangedBarrelComponent.cs @@ -157,11 +157,7 @@ namespace Content.Server.GameObjects.Components.Weapon.Ranged.Barrels { base.OnAdd(); - if (!Owner.EnsureComponent(out ServerRangedWeaponComponent rangedWeaponComponent)) - { - Logger.Warning( - $"Entity {Owner.Name} at {Owner.Transform.MapPosition} didn't have a {nameof(ServerRangedWeaponComponent)}"); - } + Owner.EnsureComponentWarn(out ServerRangedWeaponComponent rangedWeaponComponent); rangedWeaponComponent.Barrel ??= this; rangedWeaponComponent.FireHandler += Fire;