diff --git a/Content.Client/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs b/Content.Client/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs index 77fdf07c00..a31f17f075 100644 --- a/Content.Client/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs +++ b/Content.Client/CharacterAppearance/Systems/HumanoidAppearanceSystem.cs @@ -113,7 +113,7 @@ namespace Content.Client.CharacterAppearance.Systems return; } - if (!args.Args.Part.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(args.Args.Part.Owner.Uid)) { return; } @@ -137,7 +137,7 @@ namespace Content.Client.CharacterAppearance.Systems return; } - if (!args.Args.Part.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(args.Args.Part.Owner.Uid)) { return; } diff --git a/Content.Client/Chat/Managers/ChatManager.cs b/Content.Client/Chat/Managers/ChatManager.cs index 1c26965529..971a5e0a2c 100644 --- a/Content.Client/Chat/Managers/ChatManager.cs +++ b/Content.Client/Chat/Managers/ChatManager.cs @@ -231,7 +231,7 @@ namespace Content.Client.Chat.Managers ChatPermissionsUpdated?.Invoke(new ChatPermissionsUpdatedEventArgs {OldSelectableChannels = oldSelectable}); } - public bool IsGhost => _playerManager.LocalPlayer?.ControlledEntity?.HasComponent() ?? false; + public bool IsGhost => _playerManager.LocalPlayer?.ControlledEntityUid is {} uid && _entityManager.HasComponent(uid); public void FrameUpdate(FrameEventArgs delta) { diff --git a/Content.Client/Damage/DamageVisualizer.cs b/Content.Client/Damage/DamageVisualizer.cs index d5d4728172..b5e34b2f73 100644 --- a/Content.Client/Damage/DamageVisualizer.cs +++ b/Content.Client/Damage/DamageVisualizer.cs @@ -293,7 +293,7 @@ namespace Content.Client.Damage { if (!entity.TryGetComponent(out SpriteComponent? spriteComponent) || !entity.TryGetComponent(out var damageComponent) - || !entity.HasComponent()) + || !IoCManager.Resolve().HasComponent(entity.Uid)) return; _thresholds.Add(FixedPoint2.Zero); diff --git a/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs b/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs index 97d7f2c6a5..64fe31de08 100644 --- a/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs +++ b/Content.Client/Disposal/Visualizers/DisposalVisualizer.cs @@ -47,7 +47,7 @@ namespace Content.Client.Disposal.Visualizers { appearance.Owner.EnsureComponent(); } - else if (appearance.Owner.HasComponent()) + else if (IoCManager.Resolve().HasComponent(appearance.Owner.Uid)) { IoCManager.Resolve().RemoveComponent(appearance.Owner.Uid); } diff --git a/Content.Client/Doors/AirlockVisualizer.cs b/Content.Client/Doors/AirlockVisualizer.cs index e9053bc8b9..ab00a3fda1 100644 --- a/Content.Client/Doors/AirlockVisualizer.cs +++ b/Content.Client/Doors/AirlockVisualizer.cs @@ -112,7 +112,7 @@ namespace Content.Client.Doors public override void InitializeEntity(IEntity entity) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { IoCManager.Resolve().AddComponent(entity); } diff --git a/Content.Client/Hands/HandsGui.xaml.cs b/Content.Client/Hands/HandsGui.xaml.cs index ccb679790a..3777213d85 100644 --- a/Content.Client/Hands/HandsGui.xaml.cs +++ b/Content.Client/Hands/HandsGui.xaml.cs @@ -100,7 +100,7 @@ namespace Content.Client.Hands // Show blocked overlay if hand is blocked. newButton.Blocked.Visible = - hand.HeldItem != null && hand.HeldItem.HasComponent(); + hand.HeldItem != null && IoCManager.Resolve().HasComponent(hand.HeldItem.Uid); } if (TryGetActiveHand(out var activeHand)) diff --git a/Content.Client/Hands/ShowHandItemOverlay.cs b/Content.Client/Hands/ShowHandItemOverlay.cs index 8515ed9ffe..858b1267b0 100644 --- a/Content.Client/Hands/ShowHandItemOverlay.cs +++ b/Content.Client/Hands/ShowHandItemOverlay.cs @@ -46,7 +46,7 @@ namespace Content.Client.Hands var sys = EntitySystem.Get(); var handEntity = sys.GetActiveHandEntity(); - if (handEntity == null || !_cfg.GetCVar(CCVars.HudHeldItemShow) || !handEntity.HasComponent()) + if (handEntity == null || !_cfg.GetCVar(CCVars.HudHeldItemShow) || !IoCManager.Resolve().HasComponent(handEntity.Uid)) return; var screen = args.ScreenHandle; diff --git a/Content.Client/Items/Managers/ItemSlotManager.cs b/Content.Client/Items/Managers/ItemSlotManager.cs index a14eeaf264..76d7dce9b6 100644 --- a/Content.Client/Items/Managers/ItemSlotManager.cs +++ b/Content.Client/Items/Managers/ItemSlotManager.cs @@ -54,7 +54,7 @@ namespace Content.Client.Items.Managers button.ClearHover(); button.SpriteView.Sprite = sprite; - button.StorageButton.Visible = entity.HasComponent(); + button.StorageButton.Visible = IoCManager.Resolve().HasComponent(entity.Uid); } button.Entity = entity?.Uid ?? default; @@ -132,7 +132,7 @@ namespace Content.Client.Items.Managers return; } - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { return; } diff --git a/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs b/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs index 3bda991494..b4d97b990c 100644 --- a/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs +++ b/Content.Client/Lathe/Visualizers/AutolatheVisualizer.cs @@ -50,7 +50,7 @@ namespace Content.Client.Lathe.Visualizers public override void InitializeEntity(IEntity entity) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { IoCManager.Resolve().AddComponent(entity); } diff --git a/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs b/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs index d35711871f..c3088b1294 100644 --- a/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs +++ b/Content.Client/Lathe/Visualizers/ProtolatheVisualizer.cs @@ -50,7 +50,7 @@ namespace Content.Client.Lathe.Visualizers public override void InitializeEntity(IEntity entity) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { IoCManager.Resolve().AddComponent(entity); } diff --git a/Content.Client/Physics/Controllers/MoverController.cs b/Content.Client/Physics/Controllers/MoverController.cs index 1bfcb68930..2f61d90b1e 100644 --- a/Content.Client/Physics/Controllers/MoverController.cs +++ b/Content.Client/Physics/Controllers/MoverController.cs @@ -56,7 +56,7 @@ namespace Content.Client.Physics.Controllers var pulling = pullerComp.Pulling; if (pulling != null && - pulling.HasComponent() && + IoCManager.Resolve().HasComponent(pulling.Uid) && pulling.TryGetComponent(out PhysicsComponent? pullingBody)) { pullingBody.Predict = false; diff --git a/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs b/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs index 31037edec5..2830e719e0 100644 --- a/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs +++ b/Content.Client/Singularity/Visualizers/RadiationCollectorVisualizer.cs @@ -46,7 +46,7 @@ namespace Content.Client.Singularity.Visualizers public override void InitializeEntity(IEntity entity) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { IoCManager.Resolve().AddComponent(entity); } diff --git a/Content.Client/Trigger/TimerTriggerVisualizer.cs b/Content.Client/Trigger/TimerTriggerVisualizer.cs index 437d8422e6..f9dc0ced68 100644 --- a/Content.Client/Trigger/TimerTriggerVisualizer.cs +++ b/Content.Client/Trigger/TimerTriggerVisualizer.cs @@ -38,7 +38,7 @@ namespace Content.Client.Trigger public override void InitializeEntity(IEntity entity) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { IoCManager.Resolve().AddComponent(entity); } diff --git a/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs b/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs index ba7e84622a..b8e88aa4f7 100644 --- a/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs +++ b/Content.Client/VendingMachines/UI/VendingMachineVisualizer.cs @@ -121,7 +121,7 @@ namespace Content.Client.VendingMachines.UI { base.InitializeEntity(entity); - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { IoCManager.Resolve().AddComponent(entity); } diff --git a/Content.IntegrationTests/Tests/Body/LungTest.cs b/Content.IntegrationTests/Tests/Body/LungTest.cs index 4aba535f80..40721196a7 100644 --- a/Content.IntegrationTests/Tests/Body/LungTest.cs +++ b/Content.IntegrationTests/Tests/Body/LungTest.cs @@ -171,7 +171,7 @@ namespace Content.IntegrationTests.Tests.Body var coordinates = new EntityCoordinates(grid.GridEntityId, center); human = entityManager.SpawnEntity("HumanBodyAndBloodstreamDummy", coordinates); - Assert.True(human.HasComponent()); + Assert.True(IoCManager.Resolve().HasComponent(human.Uid)); Assert.True(human.TryGetComponent(out respirator)); Assert.False(respirator.Suffocating); }); diff --git a/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs b/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs index d978c81965..c4f5e010a0 100644 --- a/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs +++ b/Content.IntegrationTests/Tests/Buckle/BuckleTest.cs @@ -240,7 +240,7 @@ namespace Content.IntegrationTests.Tests.Buckle // Component sanity check Assert.True(human.TryGetComponent(out buckle)); - Assert.True(chair.HasComponent()); + Assert.True(IoCManager.Resolve().HasComponent(chair.Uid)); Assert.True(human.TryGetComponent(out hands)); Assert.True(human.TryGetComponent(out body)); @@ -325,7 +325,7 @@ namespace Content.IntegrationTests.Tests.Buckle // Component sanity check Assert.True(human.TryGetComponent(out buckle)); - Assert.True(chair.HasComponent()); + Assert.True(IoCManager.Resolve().HasComponent(chair.Uid)); // Buckle Assert.True(buckle.TryBuckle(human, chair)); diff --git a/Content.IntegrationTests/Tests/Disposal/DisposalUnitTest.cs b/Content.IntegrationTests/Tests/Disposal/DisposalUnitTest.cs index 2aef66cd5c..6765d2c6c8 100644 --- a/Content.IntegrationTests/Tests/Disposal/DisposalUnitTest.cs +++ b/Content.IntegrationTests/Tests/Disposal/DisposalUnitTest.cs @@ -7,6 +7,7 @@ using Content.Server.Power.Components; using Content.Shared.Disposal; using NUnit.Framework; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Reflection; @@ -146,7 +147,7 @@ namespace Content.IntegrationTests.Tests.Disposal // Test for components existing Assert.True(disposalUnit.TryGetComponent(out unit!)); - Assert.True(disposalTrunk.HasComponent()); + Assert.True(IoCManager.Resolve().HasComponent(disposalTrunk.Uid)); // Can't insert, unanchored and unpowered unit.Owner.Transform.Anchored = false; diff --git a/Content.IntegrationTests/Tests/GravityGridTest.cs b/Content.IntegrationTests/Tests/GravityGridTest.cs index a7767b27da..51e3fd55ed 100644 --- a/Content.IntegrationTests/Tests/GravityGridTest.cs +++ b/Content.IntegrationTests/Tests/GravityGridTest.cs @@ -50,8 +50,8 @@ namespace Content.IntegrationTests.Tests var entityMan = IoCManager.Resolve(); generator = entityMan.SpawnEntity("GravityGeneratorDummy", grid2.ToCoordinates()); - Assert.That(generator.HasComponent()); - Assert.That(generator.HasComponent()); + Assert.That(IoCManager.Resolve().HasComponent(generator.Uid)); + Assert.That(IoCManager.Resolve().HasComponent(generator.Uid)); var powerComponent = IoCManager.Resolve().GetComponent(generator.Uid); powerComponent.NeedsPower = false; diff --git a/Content.IntegrationTests/Tests/PDA/PDAExtensionsTests.cs b/Content.IntegrationTests/Tests/PDA/PDAExtensionsTests.cs index c770c4b621..c90e104c52 100644 --- a/Content.IntegrationTests/Tests/PDA/PDAExtensionsTests.cs +++ b/Content.IntegrationTests/Tests/PDA/PDAExtensionsTests.cs @@ -114,7 +114,7 @@ namespace Content.IntegrationTests.Tests.PDA continue; } - if (item.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(item.Owner.Uid)) { inventory.ForceUnequip(slot); } diff --git a/Content.Server/AI/Commands/AddAiCommand.cs b/Content.Server/AI/Commands/AddAiCommand.cs index 3a107d0133..58fa5bc8ea 100644 --- a/Content.Server/AI/Commands/AddAiCommand.cs +++ b/Content.Server/AI/Commands/AddAiCommand.cs @@ -35,14 +35,14 @@ namespace Content.Server.AI.Commands return; } - if (ent.HasComponent()) + if (IoCManager.Resolve().HasComponent(ent.Uid)) { shell.WriteLine("Entity already has an AI component."); return; } // TODO: IMover refffaaccctttooorrr - if (ent.HasComponent()) + if (IoCManager.Resolve().HasComponent(ent.Uid)) { IoCManager.Resolve().RemoveComponent(ent.Uid); } diff --git a/Content.Server/AI/EntitySystems/AiSystem.cs b/Content.Server/AI/EntitySystems/AiSystem.cs index b1793c94f6..1ad9758aae 100644 --- a/Content.Server/AI/EntitySystems/AiSystem.cs +++ b/Content.Server/AI/EntitySystems/AiSystem.cs @@ -122,7 +122,7 @@ namespace Content.Server.AI.EntitySystems private void MobStateChanged(MobStateChangedMessage message) { - if (!message.Entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(message.Entity.Uid)) { return; } diff --git a/Content.Server/AI/LoadBalancer/AiActionRequestJob.cs b/Content.Server/AI/LoadBalancer/AiActionRequestJob.cs index 7e9ef0cf4e..8cb7f356e1 100644 --- a/Content.Server/AI/LoadBalancer/AiActionRequestJob.cs +++ b/Content.Server/AI/LoadBalancer/AiActionRequestJob.cs @@ -9,6 +9,8 @@ using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Utility; using Content.Server.CPUJob.JobQueues; using Content.Shared.AI; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Utility; namespace Content.Server.AI.LoadBalancer @@ -37,7 +39,7 @@ namespace Content.Server.AI.LoadBalancer var entity = _request.Context.GetState().GetValue(); - if (entity == null || !entity.HasComponent()) + if (entity == null || !IoCManager.Resolve().HasComponent(entity.Uid)) { return null; } diff --git a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs index bff728996d..68fdb4d9f8 100644 --- a/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs +++ b/Content.Server/AI/Operators/Inventory/PickupEntityOperator.cs @@ -23,7 +23,7 @@ namespace Content.Server.AI.Operators.Inventory public override Outcome Execute(float frameTime) { if ((!IoCManager.Resolve().EntityExists(_target.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve().GetComponent(_target.Uid).EntityLifeStage) >= EntityLifeStage.Deleted || - !_target.HasComponent() || + !IoCManager.Resolve().HasComponent(_target.Uid) || _target.IsInContainer() || !_owner.InRangeUnobstructed(_target, popup: true)) { diff --git a/Content.Server/AI/Pathfinding/PathfindingNode.cs b/Content.Server/AI/Pathfinding/PathfindingNode.cs index fb9a3238f6..10dd58c9d0 100644 --- a/Content.Server/AI/Pathfinding/PathfindingNode.cs +++ b/Content.Server/AI/Pathfinding/PathfindingNode.cs @@ -4,6 +4,7 @@ using System.Linq; using Content.Server.Access.Components; using Content.Server.Doors.Components; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Physics; @@ -260,7 +261,7 @@ namespace Content.Server.AI.Pathfinding public void AddEntity(IEntity entity, IPhysBody physicsComponent) { // If we're a door - if (entity.HasComponent() || entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid) || IoCManager.Resolve().HasComponent(entity.Uid)) { // If we need access to traverse this then add to readers, otherwise no point adding it (except for maybe tile costs in future) // TODO: Check for powered I think (also need an event for when it's depowered diff --git a/Content.Server/AI/Utility/Considerations/Combat/Melee/CanUnarmedCombatCon.cs b/Content.Server/AI/Utility/Considerations/Combat/Melee/CanUnarmedCombatCon.cs index 40877f75eb..d1ef7cce19 100644 --- a/Content.Server/AI/Utility/Considerations/Combat/Melee/CanUnarmedCombatCon.cs +++ b/Content.Server/AI/Utility/Considerations/Combat/Melee/CanUnarmedCombatCon.cs @@ -1,6 +1,8 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.Weapon.Melee.Components; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.Utility.Considerations.Combat.Melee { @@ -8,7 +10,13 @@ namespace Content.Server.AI.Utility.Considerations.Combat.Melee { protected override float GetScore(Blackboard context) { - return context.GetState().GetValue()?.HasComponent() ?? false ? 1.0f : 0.0f; + IEntity tempQualifier = context.GetState().GetValue(); + if (tempQualifier != null) + { + IoCManager.Resolve().HasComponent(tempQualifier.Uid); + } + + return RETURNED_VALUE ?? false ? 1.0f : 0.0f; } } } diff --git a/Content.Server/AI/Utility/Considerations/Combat/Melee/HasMeleeWeaponCon.cs b/Content.Server/AI/Utility/Considerations/Combat/Melee/HasMeleeWeaponCon.cs index 8c62d2d56d..1f41993112 100644 --- a/Content.Server/AI/Utility/Considerations/Combat/Melee/HasMeleeWeaponCon.cs +++ b/Content.Server/AI/Utility/Considerations/Combat/Melee/HasMeleeWeaponCon.cs @@ -1,6 +1,8 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.Weapon.Melee.Components; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.Utility.Considerations.Combat.Melee { @@ -10,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.Combat.Melee { foreach (var item in context.GetState().GetValue()) { - if (item.HasComponent()) + if (IoCManager.Resolve().HasComponent(item.Uid)) { return 1.0f; } diff --git a/Content.Server/AI/Utility/Considerations/Combat/Melee/MeleeWeaponEquippedCon.cs b/Content.Server/AI/Utility/Considerations/Combat/Melee/MeleeWeaponEquippedCon.cs index 572f042409..b7650d2625 100644 --- a/Content.Server/AI/Utility/Considerations/Combat/Melee/MeleeWeaponEquippedCon.cs +++ b/Content.Server/AI/Utility/Considerations/Combat/Melee/MeleeWeaponEquippedCon.cs @@ -1,6 +1,8 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.Weapon.Melee.Components; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.Utility.Considerations.Combat.Melee { @@ -15,7 +17,7 @@ namespace Content.Server.AI.Utility.Considerations.Combat.Melee return 0.0f; } - return equipped.HasComponent() ? 1.0f : 0.0f; + return IoCManager.Resolve().HasComponent(equipped.Uid) ? 1.0f : 0.0f; } } } diff --git a/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInInventoryCon.cs b/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInInventoryCon.cs index cc7572469e..84013384b1 100644 --- a/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInInventoryCon.cs +++ b/Content.Server/AI/Utility/Considerations/Inventory/CanPutTargetInInventoryCon.cs @@ -3,6 +3,8 @@ using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Hands; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.Items; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.Utility.Considerations.Inventory { @@ -14,7 +16,7 @@ namespace Content.Server.AI.Utility.Considerations.Inventory // If not then check if we have a free hand var target = context.GetState().GetValue(); - if (target == null || !target.HasComponent()) + if (target == null || !IoCManager.Resolve().HasComponent(target.Uid)) { return 0.0f; } diff --git a/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs b/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs index 63da53c697..7cebb1dae0 100644 --- a/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs +++ b/Content.Server/AI/Utility/Considerations/Inventory/TargetInOurInventoryCon.cs @@ -2,6 +2,8 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.Items; +using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.Utility.Considerations.Inventory { @@ -11,7 +13,7 @@ namespace Content.Server.AI.Utility.Considerations.Inventory { var target = context.GetState().GetValue(); - if (target == null || !target.HasComponent()) + if (target == null || !IoCManager.Resolve().HasComponent(target.Uid)) { return 0.0f; } diff --git a/Content.Server/AI/Utility/ExpandableActions/Combat/Melee/EquipMeleeExp.cs b/Content.Server/AI/Utility/ExpandableActions/Combat/Melee/EquipMeleeExp.cs index f00032693d..0d51eeac97 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Combat/Melee/EquipMeleeExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Combat/Melee/EquipMeleeExp.cs @@ -8,6 +8,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.Weapon.Melee.Components; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; namespace Content.Server.AI.Utility.ExpandableActions.Combat.Melee @@ -33,7 +34,7 @@ namespace Content.Server.AI.Utility.ExpandableActions.Combat.Melee foreach (var entity in context.GetState().GetValue()) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { continue; } diff --git a/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseDrinkInInventoryExp.cs b/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseDrinkInInventoryExp.cs index 3abcbbcbbe..0a858d07fc 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseDrinkInInventoryExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseDrinkInInventoryExp.cs @@ -8,6 +8,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.Nutrition.Components; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; namespace Content.Server.AI.Utility.ExpandableActions.Nutrition @@ -31,7 +32,7 @@ namespace Content.Server.AI.Utility.ExpandableActions.Nutrition foreach (var entity in context.GetState().GetValue()) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { continue; } diff --git a/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseFoodInInventoryExp.cs b/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseFoodInInventoryExp.cs index 4b2fde45f0..71a65f0aca 100644 --- a/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseFoodInInventoryExp.cs +++ b/Content.Server/AI/Utility/ExpandableActions/Nutrition/UseFoodInInventoryExp.cs @@ -8,6 +8,7 @@ using Content.Server.AI.WorldState; using Content.Server.AI.WorldState.States; using Content.Server.AI.WorldState.States.Inventory; using Content.Server.Nutrition.Components; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; namespace Content.Server.AI.Utility.ExpandableActions.Nutrition @@ -31,7 +32,7 @@ namespace Content.Server.AI.Utility.ExpandableActions.Nutrition foreach (var entity in context.GetState().GetValue()) { - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { continue; } diff --git a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs index 1907c8e019..3d10e1c619 100644 --- a/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs +++ b/Content.Server/AI/WorldState/States/Clothing/NearbyClothingState.cs @@ -6,6 +6,7 @@ using Content.Server.Storage.Components; using JetBrains.Annotations; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.WorldState.States.Clothing { @@ -28,7 +29,7 @@ namespace Content.Server.AI.WorldState.States.Clothing { if (entity.TryGetContainer(out var container)) { - if (!container.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(container.Owner.Uid)) { continue; } diff --git a/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs b/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs index 3654ed86d3..1ffda4f9c5 100644 --- a/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs +++ b/Content.Server/AI/WorldState/States/Inventory/LastOpenedStorageState.cs @@ -1,5 +1,6 @@ using Content.Server.Storage.Components; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Log; namespace Content.Server.AI.WorldState.States.Inventory @@ -17,7 +18,7 @@ namespace Content.Server.AI.WorldState.States.Inventory public override void SetValue(IEntity? value) { base.SetValue(value); - if (value != null && !value.HasComponent()) + if (value != null && !IoCManager.Resolve().HasComponent(value.Uid)) { Logger.Warning("Set LastOpenedStorageState for an entity that doesn't have a storage component"); } diff --git a/Content.Server/AI/WorldState/States/Mobs/NearbyPlayersState.cs b/Content.Server/AI/WorldState/States/Mobs/NearbyPlayersState.cs index de1a38198f..8e05c82751 100644 --- a/Content.Server/AI/WorldState/States/Mobs/NearbyPlayersState.cs +++ b/Content.Server/AI/WorldState/States/Mobs/NearbyPlayersState.cs @@ -36,7 +36,7 @@ namespace Content.Server.AI.WorldState.States.Mobs continue; } - if (player.AttachedEntity != Owner && player.AttachedEntity.HasComponent()) + if (player.AttachedEntity != Owner && IoCManager.Resolve().HasComponent(player.AttachedEntity.Uid)) { result.Add(player.AttachedEntity); } diff --git a/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs b/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs index 6e64775696..9b25c5fda4 100644 --- a/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs +++ b/Content.Server/AI/WorldState/States/Nutrition/NearbyDrinkState.cs @@ -6,6 +6,7 @@ using Content.Server.Storage.Components; using JetBrains.Annotations; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.WorldState.States.Nutrition { @@ -28,7 +29,7 @@ namespace Content.Server.AI.WorldState.States.Nutrition { if (entity.TryGetContainer(out var container)) { - if (!container.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(container.Owner.Uid)) { continue; } diff --git a/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs b/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs index fea5d0e76f..728344bc21 100644 --- a/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs +++ b/Content.Server/AI/WorldState/States/Nutrition/NearbyFoodState.cs @@ -6,6 +6,7 @@ using Content.Server.Storage.Components; using JetBrains.Annotations; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; namespace Content.Server.AI.WorldState.States.Nutrition { @@ -28,7 +29,7 @@ namespace Content.Server.AI.WorldState.States.Nutrition { if (entity.TryGetContainer(out var container)) { - if (!container.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(container.Owner.Uid)) { continue; } diff --git a/Content.Server/AME/AMENodeGroup.cs b/Content.Server/AME/AMENodeGroup.cs index 9763724579..23b01bcb18 100644 --- a/Content.Server/AME/AMENodeGroup.cs +++ b/Content.Server/AME/AMENodeGroup.cs @@ -50,7 +50,7 @@ namespace Content.Server.AME { var nodeNeighbors = grid.GetCellsInSquareArea(nodeOwner.Transform.Coordinates, 1) .Select(sgc => IoCManager.Resolve().GetEntity(sgc)) - .Where(entity => entity != nodeOwner && entity.HasComponent()); + .Where(entity => entity != nodeOwner && IoCManager.Resolve().HasComponent(entity.Uid)); if (nodeNeighbors.Count() >= 8) { diff --git a/Content.Server/AME/Components/AMEPartComponent.cs b/Content.Server/AME/Components/AMEPartComponent.cs index d37b019ca9..997e3976db 100644 --- a/Content.Server/AME/Components/AMEPartComponent.cs +++ b/Content.Server/AME/Components/AMEPartComponent.cs @@ -35,7 +35,7 @@ namespace Content.Server.AME.Components async Task IInteractUsing.InteractUsing(InteractUsingEventArgs args) { - if (!args.User.HasComponent()) + if (!IoCManager.Resolve().HasComponent(args.User.Uid)) { Owner.PopupMessage(args.User, Loc.GetString("ame-part-component-interact-using-no-hands")); return false; diff --git a/Content.Server/Administration/AdminVerbSystem.cs b/Content.Server/Administration/AdminVerbSystem.cs index aee89477d1..5003573e0a 100644 --- a/Content.Server/Administration/AdminVerbSystem.cs +++ b/Content.Server/Administration/AdminVerbSystem.cs @@ -88,7 +88,7 @@ namespace Content.Server.Administration // Control mob verb if (_groupController.CanCommand(player, "controlmob") && args.User != args.Target && - args.User.HasComponent() && + IoCManager.Resolve().HasComponent(args.User.Uid) && args.Target.TryGetComponent(out var targetMind)) { Verb verb = new(); @@ -106,7 +106,7 @@ namespace Content.Server.Administration // Make Sentient verb if (_groupController.CanCommand(player, "makesentient") && args.User != args.Target && - !args.Target.HasComponent()) + !IoCManager.Resolve().HasComponent(args.Target.Uid)) { Verb verb = new(); verb.Text = Loc.GetString("make-sentient-verb-get-data-text"); @@ -138,7 +138,7 @@ namespace Content.Server.Administration // Set clothing verb if (_groupController.CanCommand(player, "setoutfit") && - args.Target.HasComponent()) + IoCManager.Resolve().HasComponent(args.Target.Uid)) { Verb verb = new(); verb.Text = Loc.GetString("set-outfit-verb-get-data-text"); @@ -206,7 +206,7 @@ namespace Content.Server.Administration // Add verb to open Solution Editor if (_groupController.CanCommand(player, "addreagent") && - args.Target.HasComponent()) + IoCManager.Resolve().HasComponent(args.Target.Uid)) { Verb verb = new(); verb.Text = Loc.GetString("edit-solutions-verb-get-data-text"); diff --git a/Content.Server/Administration/Commands/AGhost.cs b/Content.Server/Administration/Commands/AGhost.cs index 6f475375d0..822fc9b131 100644 --- a/Content.Server/Administration/Commands/AGhost.cs +++ b/Content.Server/Administration/Commands/AGhost.cs @@ -34,7 +34,7 @@ namespace Content.Server.Administration.Commands return; } - if (mind.VisitingEntity != null && mind.VisitingEntity.HasComponent()) + if (mind.VisitingEntity != null && IoCManager.Resolve().HasComponent(mind.VisitingEntity.Uid)) { player.ContentData()!.Mind?.UnVisit(); return; diff --git a/Content.Server/Administration/Commands/RejuvenateCommand.cs b/Content.Server/Administration/Commands/RejuvenateCommand.cs index 39a348bbd1..9bf43f5aca 100644 --- a/Content.Server/Administration/Commands/RejuvenateCommand.cs +++ b/Content.Server/Administration/Commands/RejuvenateCommand.cs @@ -74,7 +74,7 @@ namespace Content.Server.Administration.Commands EntitySystem.Get().SetCreamPied(target.Uid, creamPied, false); } - if (target.HasComponent()) + if (IoCManager.Resolve().HasComponent(target.Uid)) { IoCManager.Resolve().RemoveComponent(target.Uid); } diff --git a/Content.Server/Administration/Commands/SetMindCommand.cs b/Content.Server/Administration/Commands/SetMindCommand.cs index 51c856b89e..11d7150767 100644 --- a/Content.Server/Administration/Commands/SetMindCommand.cs +++ b/Content.Server/Administration/Commands/SetMindCommand.cs @@ -44,7 +44,7 @@ namespace Content.Server.Administration.Commands var target = entityManager.GetEntity(eUid); - if (!target.HasComponent()) + if (!IoCManager.Resolve().HasComponent(target.Uid)) { shell.WriteLine(Loc.GetString("set-mind-command-target-has-no-mind-message")); return; diff --git a/Content.Server/Animals/Systems/UdderSystem.cs b/Content.Server/Animals/Systems/UdderSystem.cs index 0d4e362765..823e42b253 100644 --- a/Content.Server/Animals/Systems/UdderSystem.cs +++ b/Content.Server/Animals/Systems/UdderSystem.cs @@ -123,7 +123,7 @@ namespace Content.Server.Animals.Systems { if (args.Using == null || !args.CanInteract || - !args.Using.HasComponent()) + !IoCManager.Resolve().HasComponent(args.Using.Uid)) return; Verb verb = new(); diff --git a/Content.Server/Atmos/Commands/AddAtmosCommand.cs b/Content.Server/Atmos/Commands/AddAtmosCommand.cs index 6b6a467009..412f21e3f1 100644 --- a/Content.Server/Atmos/Commands/AddAtmosCommand.cs +++ b/Content.Server/Atmos/Commands/AddAtmosCommand.cs @@ -47,7 +47,7 @@ namespace Content.Server.Atmos.Commands return; } - if (grid.HasComponent()) + if (IoCManager.Resolve().HasComponent(grid.Uid)) { shell.WriteLine("Grid already has an atmosphere."); return; diff --git a/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs b/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs index e68dacd958..4ca0658ff1 100644 --- a/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs +++ b/Content.Server/Atmos/Commands/AddUnsimulatedAtmosCommand.cs @@ -47,7 +47,7 @@ namespace Content.Server.Atmos.Commands return; } - if (grid.HasComponent()) + if (IoCManager.Resolve().HasComponent(grid.Uid)) { shell.WriteLine("Grid already has an atmosphere."); return; diff --git a/Content.Server/Atmos/Components/MovedByPressureComponent.cs b/Content.Server/Atmos/Components/MovedByPressureComponent.cs index 17c2973d24..c9787d7e7e 100644 --- a/Content.Server/Atmos/Components/MovedByPressureComponent.cs +++ b/Content.Server/Atmos/Components/MovedByPressureComponent.cs @@ -61,7 +61,7 @@ namespace Content.Server.Atmos.Components && (maxForce >= (MoveResist * MoveForcePushRatio))) || (physics.BodyType == BodyType.Static && (maxForce >= (MoveResist * MoveForceForcePushRatio)))) { - if (physics.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(physics.Owner.Uid)) { physics.BodyStatus = BodyStatus.InAir; @@ -75,7 +75,7 @@ namespace Content.Server.Atmos.Components if (Deleted || !Owner.TryGetComponent(out PhysicsComponent? physicsComponent)) return; // Uhh if you get race conditions good luck buddy. - if (physicsComponent.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(physicsComponent.Owner.Uid)) { physicsComponent.BodyStatus = BodyStatus.OnGround; } diff --git a/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs b/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs index bece574f9f..7e577a3758 100644 --- a/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs +++ b/Content.Server/Body/Surgery/BiologicalSurgeryDataComponent.cs @@ -8,6 +8,7 @@ using Content.Shared.Body.Part; using Content.Shared.Body.Surgery; using Content.Shared.Popups; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using static Content.Shared.Body.Surgery.ISurgeryData; @@ -52,7 +53,7 @@ namespace Content.Server.Body.Surgery private async Task SurgeryDoAfter(IEntity performer) { - if (!performer.HasComponent()) + if (!IoCManager.Resolve().HasComponent(performer.Uid)) { return true; } @@ -298,7 +299,7 @@ namespace Content.Server.Body.Surgery performer.PopupMessage(Loc.GetString("biological-surgery-data-component-loosen-organ-message")); - if (!performer.HasComponent()) + if (!IoCManager.Resolve().HasComponent(performer.Uid)) { AddDisconnectedOrgan(target); return; @@ -339,7 +340,7 @@ namespace Content.Server.Body.Surgery performer.PopupMessage(Loc.GetString("biological-surgery-data-component-remove-organ-message")); - if (!performer.HasComponent()) + if (!IoCManager.Resolve().HasComponent(performer.Uid)) { Parent.RemoveMechanism(target, performer.Transform.Coordinates); RemoveDisconnectedOrgan(target); diff --git a/Content.Server/Buckle/Components/BuckleComponent.cs b/Content.Server/Buckle/Components/BuckleComponent.cs index 0113482c05..cea4458fe5 100644 --- a/Content.Server/Buckle/Components/BuckleComponent.cs +++ b/Content.Server/Buckle/Components/BuckleComponent.cs @@ -178,7 +178,7 @@ namespace Content.Server.Buckle.Components } } - if (!user.HasComponent()) + if (!IoCManager.Resolve().HasComponent(user.Uid)) { user.PopupMessage(Loc.GetString("buckle-component-no-hands-message ")); return false; @@ -325,7 +325,7 @@ namespace Content.Server.Buckle.Components Appearance?.SetData(BuckleVisuals.Buckled, false); - if (Owner.HasComponent() + if (IoCManager.Resolve().HasComponent(Owner.Uid) || (_mobState?.IsIncapacitated() ?? false)) { EntitySystem.Get().Down(Owner.Uid); diff --git a/Content.Server/Buckle/Systems/StrapSystem.cs b/Content.Server/Buckle/Systems/StrapSystem.cs index 929ce7abbb..a0c038472b 100644 --- a/Content.Server/Buckle/Systems/StrapSystem.cs +++ b/Content.Server/Buckle/Systems/StrapSystem.cs @@ -92,7 +92,7 @@ namespace Content.Server.Buckle.Systems // If the used entity is a person being pulled, prioritize this verb. Conversely, if it is // just a held object, the user is probably just trying to sit down. - verb.Priority = args.Using.HasComponent() ? 1 : -1; + verb.Priority = IoCManager.Resolve().HasComponent(args.Using.Uid) ? 1 : -1; args.Verbs.Add(verb); } diff --git a/Content.Server/Cargo/Components/CargoConsoleComponent.cs b/Content.Server/Cargo/Components/CargoConsoleComponent.cs index a5fe03a8c4..fac57efc0b 100644 --- a/Content.Server/Cargo/Components/CargoConsoleComponent.cs +++ b/Content.Server/Cargo/Components/CargoConsoleComponent.cs @@ -175,7 +175,7 @@ namespace Content.Server.Cargo.Components { foreach (IEntity entity in enumerator) { - if (entity.HasComponent() && entity.TryGetComponent(out var powerReceiver) && powerReceiver.Powered) + if (IoCManager.Resolve().HasComponent(entity.Uid) && entity.TryGetComponent(out var powerReceiver) && powerReceiver.Powered) { cargoTelepad = entity; break; diff --git a/Content.Server/Chat/Commands/SayCommand.cs b/Content.Server/Chat/Commands/SayCommand.cs index 5a31e561d7..f63f5c699b 100644 --- a/Content.Server/Chat/Commands/SayCommand.cs +++ b/Content.Server/Chat/Commands/SayCommand.cs @@ -5,6 +5,7 @@ using Content.Server.Players; using Robust.Server.Player; using Robust.Shared.Console; using Robust.Shared.Enums; +using Robust.Shared.GameObjects; using Robust.Shared.IoC; namespace Content.Server.Chat.Commands @@ -45,7 +46,7 @@ namespace Content.Server.Chat.Commands return; } - if (playerEntity.HasComponent()) + if (IoCManager.Resolve().HasComponent(playerEntity.Uid)) chat.SendDeadChat(player, message); else { diff --git a/Content.Server/Chat/Commands/SuicideCommand.cs b/Content.Server/Chat/Commands/SuicideCommand.cs index 070b63673c..065402793d 100644 --- a/Content.Server/Chat/Commands/SuicideCommand.cs +++ b/Content.Server/Chat/Commands/SuicideCommand.cs @@ -107,7 +107,7 @@ namespace Content.Server.Chat.Commands { foreach (var entity in entities) { - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) continue; var suicide = IoCManager.Resolve().GetComponents(entity.Uid).FirstOrDefault(); if (suicide != null) diff --git a/Content.Server/Chat/Managers/ChatManager.cs b/Content.Server/Chat/Managers/ChatManager.cs index cbad133f93..bb77d2c220 100644 --- a/Content.Server/Chat/Managers/ChatManager.cs +++ b/Content.Server/Chat/Managers/ChatManager.cs @@ -153,7 +153,7 @@ namespace Content.Server.Chat.Managers var transform = player.AttachedEntity.Transform; if (transform.MapID != sourceMapId || - !player.AttachedEntity.HasComponent() && + !IoCManager.Resolve().HasComponent(player.AttachedEntity.Uid) && !sourceCoords.InRange(_entManager, transform.Coordinates, VoiceRange)) continue; clients.Add(player.ConnectedClient); diff --git a/Content.Server/Chemistry/Components/HyposprayComponent.cs b/Content.Server/Chemistry/Components/HyposprayComponent.cs index f20f1e16c2..dfe2aea594 100644 --- a/Content.Server/Chemistry/Components/HyposprayComponent.cs +++ b/Content.Server/Chemistry/Components/HyposprayComponent.cs @@ -116,8 +116,8 @@ namespace Content.Server.Chemistry.Components // TODO: Does checking for BodyComponent make sense as a "can be hypospray'd" tag? // In SS13 the hypospray ONLY works on mobs, NOT beakers or anything else. - return entity.HasComponent() - && entity.HasComponent(); + return IoCManager.Resolve().HasComponent(entity.Uid) + && IoCManager.Resolve().HasComponent(entity.Uid); } return true; diff --git a/Content.Server/Chemistry/Components/InjectorComponent.cs b/Content.Server/Chemistry/Components/InjectorComponent.cs index 7a71e5b1f6..f8e42d229c 100644 --- a/Content.Server/Chemistry/Components/InjectorComponent.cs +++ b/Content.Server/Chemistry/Components/InjectorComponent.cs @@ -117,7 +117,7 @@ namespace Content.Server.Chemistry.Components var solutionsSys = EntitySystem.Get(); //Make sure we have the attacking entity - if (eventArgs.Target == null || !Owner.HasComponent()) + if (eventArgs.Target == null || !IoCManager.Resolve().HasComponent(Owner.Uid)) { return false; } diff --git a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs index 729107cafb..fd99b9c9dd 100644 --- a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs @@ -46,7 +46,7 @@ namespace Content.Server.Chemistry.Components if (Inception != null) return; - if (Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(Owner.Uid)) return; Amount = amount; diff --git a/Content.Server/Chemistry/Components/SolutionTransferComponent.cs b/Content.Server/Chemistry/Components/SolutionTransferComponent.cs index c25d602c35..0ef6543843 100644 --- a/Content.Server/Chemistry/Components/SolutionTransferComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionTransferComponent.cs @@ -12,6 +12,7 @@ using Content.Shared.Interaction.Helpers; using Content.Shared.Popups; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -115,11 +116,11 @@ namespace Content.Server.Chemistry.Components if (!eventArgs.InRangeUnobstructed() || eventArgs.Target == null) return false; - if (!Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(Owner.Uid)) return false; var target = eventArgs.Target!; - if (!target.HasComponent()) + if (!IoCManager.Resolve().HasComponent(target.Uid)) { return false; } diff --git a/Content.Server/Climbing/Components/ClimbableComponent.cs b/Content.Server/Climbing/Components/ClimbableComponent.cs index 7512226db0..042087ca11 100644 --- a/Content.Server/Climbing/Components/ClimbableComponent.cs +++ b/Content.Server/Climbing/Components/ClimbableComponent.cs @@ -74,7 +74,7 @@ namespace Content.Server.Climbing.Components return false; } - if (!user.HasComponent() || + if (!IoCManager.Resolve().HasComponent(user.Uid) || !user.TryGetComponent(out SharedBodyComponent? body)) { reason = Loc.GetString("comp-climbable-cant-climb"); @@ -114,7 +114,7 @@ namespace Content.Server.Climbing.Components return false; } - if (target == null || !dragged.HasComponent()) + if (target == null || !IoCManager.Resolve().HasComponent(dragged.Uid)) { reason = Loc.GetString("comp-climbable-cant-climb"); return false; diff --git a/Content.Server/Construction/Commands/FixRotationsCommand.cs b/Content.Server/Construction/Commands/FixRotationsCommand.cs index 318c21edc9..61e181eeef 100644 --- a/Content.Server/Construction/Commands/FixRotationsCommand.cs +++ b/Content.Server/Construction/Commands/FixRotationsCommand.cs @@ -83,9 +83,9 @@ namespace Content.Server.Construction.Commands valid |= occluder.Enabled; } // low walls & grilles - valid |= childEntity.HasComponent(); + valid |= IoCManager.Resolve().HasComponent(childEntity.Uid); // cables - valid |= childEntity.HasComponent(); + valid |= IoCManager.Resolve().HasComponent(childEntity.Uid); // anything else that might need this forced valid |= childEntity.HasTag("ForceFixRotations"); // override diff --git a/Content.Server/Conveyor/ConveyorSystem.cs b/Content.Server/Conveyor/ConveyorSystem.cs index 9c846a8cd9..a1a46fd3c9 100644 --- a/Content.Server/Conveyor/ConveyorSystem.cs +++ b/Content.Server/Conveyor/ConveyorSystem.cs @@ -106,7 +106,7 @@ namespace Content.Server.Conveyor return false; } - if (component.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(component.Owner.Uid)) { return false; } @@ -150,7 +150,7 @@ namespace Content.Server.Conveyor continue; } - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) { continue; } diff --git a/Content.Server/Cuffs/Components/CuffableComponent.cs b/Content.Server/Cuffs/Components/CuffableComponent.cs index a8b7b95e7a..b795502695 100644 --- a/Content.Server/Cuffs/Components/CuffableComponent.cs +++ b/Content.Server/Cuffs/Components/CuffableComponent.cs @@ -92,7 +92,7 @@ namespace Content.Server.Cuffs.Components /// public bool TryAddNewCuffs(IEntity user, IEntity handcuff) { - if (!handcuff.HasComponent()) + if (!IoCManager.Resolve().HasComponent(handcuff.Uid)) { Logger.Warning($"Handcuffs being applied to player are missing a {nameof(HandcuffComponent)}!"); return false; diff --git a/Content.Server/Cuffs/Components/HandcuffComponent.cs b/Content.Server/Cuffs/Components/HandcuffComponent.cs index 6110ff60dc..1de8c3c770 100644 --- a/Content.Server/Cuffs/Components/HandcuffComponent.cs +++ b/Content.Server/Cuffs/Components/HandcuffComponent.cs @@ -12,6 +12,7 @@ using Content.Shared.Sound; using Content.Shared.Stunnable; using Robust.Shared.Audio; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Maths; using Robust.Shared.Player; @@ -198,7 +199,7 @@ namespace Content.Server.Cuffs.Components { var cuffTime = CuffTime; - if (target.HasComponent()) + if (IoCManager.Resolve().HasComponent(target.Uid)) { cuffTime = MathF.Max(0.1f, cuffTime - StunBonus); } diff --git a/Content.Server/Disposal/Unit/Components/DisposalHolderComponent.cs b/Content.Server/Disposal/Unit/Components/DisposalHolderComponent.cs index 79d6c804f7..dac575cb21 100644 --- a/Content.Server/Disposal/Unit/Components/DisposalHolderComponent.cs +++ b/Content.Server/Disposal/Unit/Components/DisposalHolderComponent.cs @@ -84,8 +84,8 @@ namespace Content.Server.Disposal.Unit.Components return false; } - return entity.HasComponent() || - entity.HasComponent(); + return IoCManager.Resolve().HasComponent(entity.Uid) || + IoCManager.Resolve().HasComponent(entity.Uid); } public bool TryInsert(IEntity entity) diff --git a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs index 38e4436659..c2d3963f96 100644 --- a/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs +++ b/Content.Server/Disposal/Unit/EntitySystems/DisposalUnitSystem.cs @@ -238,7 +238,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems UpdateInterface(component, component.Powered); - if (!component.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(component.Owner.Uid)) { Logger.WarningS("VitalComponentMissing", $"Disposal unit {uid} is missing an {nameof(AnchorableComponent)}"); } @@ -395,7 +395,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems } // This popup message doesn't appear on clicks, even when code was seperate. Unsure why. - if (!eventArgs.User.HasComponent()) + if (!IoCManager.Resolve().HasComponent(eventArgs.User.Uid)) { eventArgs.Target.PopupMessage(eventArgs.User, Loc.GetString("ui-disposal-unit-is-valid-interaction-no-hands")); return false; diff --git a/Content.Server/Doors/Components/ServerDoorComponent.cs b/Content.Server/Doors/Components/ServerDoorComponent.cs index c771738ae9..c7f0c54fe7 100644 --- a/Content.Server/Doors/Components/ServerDoorComponent.cs +++ b/Content.Server/Doors/Components/ServerDoorComponent.cs @@ -583,7 +583,7 @@ namespace Content.Server.Doors.Components hitsomebody = true; CurrentlyCrushing.Add(e.Owner.Uid); - if (e.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(e.Owner.Uid)) EntitySystem.Get().TryChangeDamage(e.Owner.Uid, CrushDamage); EntitySystem.Get().TryParalyze(e.Owner.Uid, TimeSpan.FromSeconds(DoorStunTime)); diff --git a/Content.Server/Doors/Systems/DoorSystem.cs b/Content.Server/Doors/Systems/DoorSystem.cs index e24a838fa9..ca1e6dca39 100644 --- a/Content.Server/Doors/Systems/DoorSystem.cs +++ b/Content.Server/Doors/Systems/DoorSystem.cs @@ -1,6 +1,7 @@ using Content.Server.Doors.Components; using Content.Shared.Doors; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Physics.Dynamics; namespace Content.Server.Doors @@ -45,7 +46,7 @@ namespace Content.Server.Doors private void HandleCollide(EntityUid uid, ServerDoorComponent component, StartCollideEvent args) { - if (!args.OtherFixture.Body.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(args.OtherFixture.Body.Owner.Uid)) { return; } diff --git a/Content.Server/Electrocution/ElectrocutionSystem.cs b/Content.Server/Electrocution/ElectrocutionSystem.cs index 21613e83c2..a374d79819 100644 --- a/Content.Server/Electrocution/ElectrocutionSystem.cs +++ b/Content.Server/Electrocution/ElectrocutionSystem.cs @@ -158,7 +158,7 @@ namespace Content.Server.Electrocution foreach (var entity in transform.Coordinates.GetEntitiesInTile( LookupFlags.Approximate | LookupFlags.IncludeAnchored, _entityLookup)) { - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) return false; } } diff --git a/Content.Server/Explosion/Components/ClusterFlashComponent.cs b/Content.Server/Explosion/Components/ClusterFlashComponent.cs index cbc43c540e..b12fd96e75 100644 --- a/Content.Server/Explosion/Components/ClusterFlashComponent.cs +++ b/Content.Server/Explosion/Components/ClusterFlashComponent.cs @@ -60,7 +60,7 @@ namespace Content.Server.Explosion.Components async Task IInteractUsing.InteractUsing(InteractUsingEventArgs args) { if (_grenadesContainer.ContainedEntities.Count >= _maxGrenades || - !args.Using.HasComponent()) + !IoCManager.Resolve().HasComponent(args.Using.Uid)) return false; _grenadesContainer.Insert(args.Using); diff --git a/Content.Server/Extinguisher/FireExtinguisherComponent.cs b/Content.Server/Extinguisher/FireExtinguisherComponent.cs index 6a88316af5..5d90ce7b9f 100644 --- a/Content.Server/Extinguisher/FireExtinguisherComponent.cs +++ b/Content.Server/Extinguisher/FireExtinguisherComponent.cs @@ -12,6 +12,7 @@ using Content.Shared.Extinguisher; using Content.Shared.FixedPoint; using Robust.Shared.Audio; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Player; using Robust.Shared.Serialization.Manager.Attributes; @@ -59,7 +60,7 @@ namespace Content.Server.Extinguisher } var targetEntity = eventArgs.Target; - if (eventArgs.Target.HasComponent() + if (IoCManager.Resolve().HasComponent(eventArgs.Target.Uid) && solutionContainerSystem.TryGetDrainableSolution(targetEntity.Uid, out var targetSolution) && solutionContainerSystem.TryGetDrainableSolution(Owner.Uid, out var container)) { diff --git a/Content.Server/Flash/FlashSystem.cs b/Content.Server/Flash/FlashSystem.cs index bb281adbba..173e920c64 100644 --- a/Content.Server/Flash/FlashSystem.cs +++ b/Content.Server/Flash/FlashSystem.cs @@ -63,7 +63,7 @@ namespace Content.Server.Flash return; } - if (args.Entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(args.Entity.Uid)) { args.CanInteract = true; Flash(args.Entity.Uid, args.User.Uid, uid, comp.FlashDuration, comp.SlowTo); @@ -155,7 +155,7 @@ namespace Content.Server.Flash foreach (var entity in _entityLookup.GetEntitiesInRange(transform.Coordinates, range)) { - if (!entity.HasComponent() || + if (!IoCManager.Resolve().HasComponent(entity.Uid) || !transform.InRangeUnobstructed(entity, range, CollisionGroup.Opaque)) continue; Flash(entity.Uid, user, source, duration, slowTo, displayPopup); diff --git a/Content.Server/GameTicking/Presets/GamePreset.cs b/Content.Server/GameTicking/Presets/GamePreset.cs index 241c54473a..7756df24aa 100644 --- a/Content.Server/GameTicking/Presets/GamePreset.cs +++ b/Content.Server/GameTicking/Presets/GamePreset.cs @@ -39,7 +39,7 @@ namespace Content.Server.GameTicking.Presets { var playerEntity = mind.OwnedEntity; - if (playerEntity != null && playerEntity.HasComponent()) + if (playerEntity != null && IoCManager.Resolve().HasComponent(playerEntity.Uid)) return false; if (mind.VisitingEntity != null) diff --git a/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs b/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs index 0531454756..d47fe15ab1 100644 --- a/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs +++ b/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs @@ -208,7 +208,7 @@ namespace Content.Server.GameTicking.Presets } else if (!mobState.IsDead()) { - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) { return false; } diff --git a/Content.Server/GameTicking/Rules/RuleSuspicion.cs b/Content.Server/GameTicking/Rules/RuleSuspicion.cs index d5634d7ff2..1d48c92ab0 100644 --- a/Content.Server/GameTicking/Rules/RuleSuspicion.cs +++ b/Content.Server/GameTicking/Rules/RuleSuspicion.cs @@ -92,7 +92,7 @@ namespace Content.Server.GameTicking.Rules { if (playerSession.AttachedEntity == null || !playerSession.AttachedEntity.TryGetComponent(out MobStateComponent? mobState) - || !playerSession.AttachedEntity.HasComponent()) + || !IoCManager.Resolve().HasComponent(playerSession.AttachedEntity.Uid)) { continue; } diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index b6fe399e49..adf783b4cd 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -117,7 +117,7 @@ namespace Content.Server.Ghost var entity = args.SenderSession.AttachedEntity; if (entity == null || - !entity.HasComponent()) + !IoCManager.Resolve().HasComponent(entity.Uid)) { Logger.Warning($"User {args.SenderSession.Name} sent a {nameof(GhostWarpsRequestEvent)} without being a ghost."); return; diff --git a/Content.Server/Ghost/Roles/GhostRoleSystem.cs b/Content.Server/Ghost/Roles/GhostRoleSystem.cs index 86be3f020d..564c69e278 100644 --- a/Content.Server/Ghost/Roles/GhostRoleSystem.cs +++ b/Content.Server/Ghost/Roles/GhostRoleSystem.cs @@ -59,7 +59,7 @@ namespace Content.Server.Ghost.Roles public void OpenEui(IPlayerSession session) { - if (session.AttachedEntity == null || !session.AttachedEntity.HasComponent()) + if (session.AttachedEntity == null || !IoCManager.Resolve().HasComponent(session.AttachedEntity.Uid)) return; if(_openUis.ContainsKey(session)) @@ -194,7 +194,7 @@ namespace Content.Server.Ghost.Roles { // Close the session of any player that has a ghost roles window open and isn't a ghost anymore. if (!_openUis.ContainsKey(message.Player)) return; - if (message.Entity.HasComponent()) return; + if (IoCManager.Resolve().HasComponent(message.Entity.Uid)) return; CloseEui(message.Player); } diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index 8cb5397ecd..6c9dfbaec1 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -173,7 +173,7 @@ namespace Content.Server.Hands.Systems { foreach (var inhand in component.GetAllHeldItems()) { - if (inhand.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(inhand.Owner.Uid)) continue; args.PushText(Loc.GetString("comp-hands-examine", ("user", component.Owner), ("item", inhand.Owner))); diff --git a/Content.Server/Interaction/InteractionSystem.cs b/Content.Server/Interaction/InteractionSystem.cs index e39f2a418c..5cdc5c5727 100644 --- a/Content.Server/Interaction/InteractionSystem.cs +++ b/Content.Server/Interaction/InteractionSystem.cs @@ -240,7 +240,7 @@ namespace Content.Server.Interaction /// internal void AiUseInteraction(IEntity entity, EntityCoordinates coords, EntityUid uid) { - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) throw new InvalidOperationException(); UserInteraction(entity, coords, uid); @@ -522,7 +522,7 @@ namespace Content.Server.Interaction } else if (!wideAttack && (targetEnt != null || EntityManager.TryGetEntity(targetUid, out targetEnt)) && - targetEnt.HasComponent()) + IoCManager.Resolve().HasComponent(targetEnt.Uid)) { // We pick up items if our hand is empty, even if we're in combat mode. InteractHand(user, targetEnt); diff --git a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs index 1237f14fb6..726af14961 100644 --- a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs @@ -54,7 +54,7 @@ namespace Content.Server.Kitchen.EntitySystems { if (args.Handled) return; - if (!args.User.HasComponent()) + if (!IoCManager.Resolve().HasComponent(args.User.Uid)) { component.Owner.PopupMessage(args.User, Loc.GetString("reagent-grinder-component-interact-using-no-hands")); @@ -341,7 +341,7 @@ namespace Content.Server.Kitchen.EntitySystems continue; } var juiceEvent = new ExtractableScalingEvent(); // default of scalar is always 1.0 - if (item.HasComponent()) + if (IoCManager.Resolve().HasComponent(item.Uid)) { RaiseLocalEvent(item.Uid, juiceEvent); } diff --git a/Content.Server/Lathe/Components/LatheComponent.cs b/Content.Server/Lathe/Components/LatheComponent.cs index 2e689757ef..9797b2d907 100644 --- a/Content.Server/Lathe/Components/LatheComponent.cs +++ b/Content.Server/Lathe/Components/LatheComponent.cs @@ -75,7 +75,7 @@ namespace Content.Server.Lathe.Components } break; case LatheSyncRequestMessage _: - if (!Owner.HasComponent()) return; + if (!IoCManager.Resolve().HasComponent(Owner.Uid)) return; UserInterface?.SendMessage(new LatheFullQueueMessage(GetIdQueue())); if (_producingRecipe != null) UserInterface?.SendMessage(new LatheProducingRecipeMessage(_producingRecipe.ID)); diff --git a/Content.Server/Mind/Mind.cs b/Content.Server/Mind/Mind.cs index 1e0c481c42..452db0ea44 100644 --- a/Content.Server/Mind/Mind.cs +++ b/Content.Server/Mind/Mind.cs @@ -377,7 +377,7 @@ namespace Content.Server.Mind DebugTools.AssertNotNull(oldVisitingEnt); - if (oldVisitingEnt!.HasComponent()) + if (IoCManager.Resolve().HasComponent(oldVisitingEnt!.Uid)) { IoCManager.Resolve().RemoveComponent(oldVisitingEnt.Uid); } diff --git a/Content.Server/Morgue/Components/BodyBagEntityStorageComponent.cs b/Content.Server/Morgue/Components/BodyBagEntityStorageComponent.cs index 0489e4a2a9..b59b46ebe7 100644 --- a/Content.Server/Morgue/Components/BodyBagEntityStorageComponent.cs +++ b/Content.Server/Morgue/Components/BodyBagEntityStorageComponent.cs @@ -12,6 +12,7 @@ using Content.Shared.Standing; using Robust.Server.GameObjects; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Utility; using Robust.Shared.ViewVariables; @@ -28,7 +29,7 @@ namespace Content.Server.Morgue.Components protected override bool AddToContents(IEntity entity) { - if (entity.HasComponent() && !EntitySystem.Get().IsDown(entity.Uid)) return false; + if (IoCManager.Resolve().HasComponent(entity.Uid) && !EntitySystem.Get().IsDown(entity.Uid)) return false; return base.AddToContents(entity); } } diff --git a/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs b/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs index 61182dff78..aadfc7d3f2 100644 --- a/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs +++ b/Content.Server/Morgue/Components/MorgueEntityStorageComponent.cs @@ -71,7 +71,7 @@ namespace Content.Server.Morgue.Components protected override bool AddToContents(IEntity entity) { - if (entity.HasComponent() && !EntitySystem.Get().IsDown(entity.Uid)) + if (IoCManager.Resolve().HasComponent(entity.Uid) && !EntitySystem.Get().IsDown(entity.Uid)) return false; return base.AddToContents(entity); } @@ -122,7 +122,7 @@ namespace Content.Server.Morgue.Components foreach (var entity in Contents.ContainedEntities) { count++; - if (!hasMob && entity.HasComponent()) + if (!hasMob && IoCManager.Resolve().HasComponent(entity.Uid)) hasMob = true; if (!hasSoul && entity.TryGetComponent(out var actor) && actor.PlayerSession != null) hasSoul = true; diff --git a/Content.Server/PDA/PDASystem.cs b/Content.Server/PDA/PDASystem.cs index 391d2ce00b..0bde413992 100644 --- a/Content.Server/PDA/PDASystem.cs +++ b/Content.Server/PDA/PDASystem.cs @@ -136,7 +136,7 @@ namespace Content.Server.PDA JobTitle = pda.ContainedID?.JobTitle }; - var hasUplink = pda.Owner.HasComponent(); + var hasUplink = IoCManager.Resolve().HasComponent(pda.Owner.Uid); var ui = pda.Owner.GetUIOrNull(PDAUiKey.Key); ui?.SetState(new PDAUpdateState(pda.FlashlightOn, pda.PenSlot.HasItem, ownerInfo, hasUplink)); diff --git a/Content.Server/Physics/Controllers/SingularityController.cs b/Content.Server/Physics/Controllers/SingularityController.cs index 4c64b5ee9c..371536871f 100644 --- a/Content.Server/Physics/Controllers/SingularityController.cs +++ b/Content.Server/Physics/Controllers/SingularityController.cs @@ -21,7 +21,7 @@ namespace Content.Server.Physics.Controllers foreach (var (singularity, physics) in EntityManager.EntityQuery()) { - if (singularity.Owner.HasComponent() || + if (IoCManager.Resolve().HasComponent(singularity.Owner.Uid) || singularity.BeingDeletedByAnotherSingularity) continue; singularity.MoveAccumulator -= frameTime; diff --git a/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs b/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs index b243ee242c..12cf5d627e 100644 --- a/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs +++ b/Content.Server/PneumaticCannon/PneumaticCannonSystem.cs @@ -98,7 +98,7 @@ namespace Content.Server.PneumaticCannon private void OnInteractUsing(EntityUid uid, PneumaticCannonComponent component, InteractUsingEvent args) { args.Handled = true; - if (args.Used.HasComponent() + if (IoCManager.Resolve().HasComponent(args.Used.Uid) && component.GasTankSlot.CanInsert(args.Used) && component.GasTankRequired) { diff --git a/Content.Server/Pointing/EntitySystems/PointingSystem.cs b/Content.Server/Pointing/EntitySystems/PointingSystem.cs index c299e55fb9..4f4d77d7e3 100644 --- a/Content.Server/Pointing/EntitySystems/PointingSystem.cs +++ b/Content.Server/Pointing/EntitySystems/PointingSystem.cs @@ -80,7 +80,7 @@ namespace Content.Server.Pointing.EntitySystems public bool InRange(IEntity pointer, EntityCoordinates coordinates) { - if (pointer.HasComponent()) + if (IoCManager.Resolve().HasComponent(pointer.Uid)) { return pointer.Transform.Coordinates.InRange(EntityManager, coordinates, 15); } @@ -105,7 +105,7 @@ namespace Content.Server.Pointing.EntitySystems return false; } - if (EntityManager.TryGetEntity(uid, out var entity) && entity.HasComponent()) + if (EntityManager.TryGetEntity(uid, out var entity) && IoCManager.Resolve().HasComponent(entity.Uid)) { // this is a pointing arrow. no pointing here... return false; @@ -200,7 +200,7 @@ namespace Content.Server.Pointing.EntitySystems return; //Check if the object is already being pointed at - if (args.Target.HasComponent()) + if (IoCManager.Resolve().HasComponent(args.Target.Uid)) return; if (!args.User.TryGetComponent(out var actor) || diff --git a/Content.Server/PowerCell/Components/PowerCellChargerComponent.cs b/Content.Server/PowerCell/Components/PowerCellChargerComponent.cs index c0291aa5f6..82910cfc91 100644 --- a/Content.Server/PowerCell/Components/PowerCellChargerComponent.cs +++ b/Content.Server/PowerCell/Components/PowerCellChargerComponent.cs @@ -17,7 +17,7 @@ namespace Content.Server.PowerCell.Components public override bool IsEntityCompatible(IEntity entity) { - return entity.HasComponent(); + return IoCManager.Resolve().HasComponent(entity.Uid); } protected override BatteryComponent GetBatteryFrom(IEntity entity) diff --git a/Content.Server/PowerCell/PowerCellSystem.cs b/Content.Server/PowerCell/PowerCellSystem.cs index 02595812ce..b193ade3ca 100644 --- a/Content.Server/PowerCell/PowerCellSystem.cs +++ b/Content.Server/PowerCell/PowerCellSystem.cs @@ -47,7 +47,7 @@ namespace Content.Server.PowerCell !args.CanAccess || !args.CanInteract || component.HasCell || - !args.Using.HasComponent() || + !IoCManager.Resolve().HasComponent(args.Using.Uid) || !_actionBlockerSystem.CanDrop(args.User.Uid)) return; diff --git a/Content.Server/Projectiles/ProjectileSystem.cs b/Content.Server/Projectiles/ProjectileSystem.cs index f5f06d411e..c4adb0d4a3 100644 --- a/Content.Server/Projectiles/ProjectileSystem.cs +++ b/Content.Server/Projectiles/ProjectileSystem.cs @@ -40,7 +40,7 @@ namespace Content.Server.Projectiles var playerFilter = Filter.Pvs(coordinates); if (!((!IoCManager.Resolve().EntityExists(otherEntity.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve().GetComponent(otherEntity.Uid).EntityLifeStage) >= EntityLifeStage.Deleted) && component.SoundHitSpecies != null && - otherEntity.HasComponent()) + IoCManager.Resolve().HasComponent(otherEntity.Uid)) { SoundSystem.Play(playerFilter, component.SoundHitSpecies.GetSound(), coordinates); } diff --git a/Content.Server/Recycling/RecyclerSystem.cs b/Content.Server/Recycling/RecyclerSystem.cs index 7e022afb6d..6ea28f38a0 100644 --- a/Content.Server/Recycling/RecyclerSystem.cs +++ b/Content.Server/Recycling/RecyclerSystem.cs @@ -45,7 +45,7 @@ namespace Content.Server.Recycling private bool CanGib(RecyclerComponent component, IEntity entity) { // We suppose this entity has a Recyclable component. - return entity.HasComponent() && !component.Safe && + return IoCManager.Resolve().HasComponent(entity.Uid) && !component.Safe && component.Owner.TryGetComponent(out ApcPowerReceiverComponent? receiver) && receiver.Powered; } diff --git a/Content.Server/Sandbox/SandboxManager.cs b/Content.Server/Sandbox/SandboxManager.cs index b0479963d3..ac982f0770 100644 --- a/Content.Server/Sandbox/SandboxManager.cs +++ b/Content.Server/Sandbox/SandboxManager.cs @@ -127,7 +127,7 @@ namespace Content.Server.Sandbox if (player.AttachedEntity.TryGetComponent(out InventoryComponent? inv) && inv.TryGetSlotItem(Slots.IDCARD, out ItemComponent? wornItem)) { - if (wornItem.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(wornItem.Owner.Uid)) { UpgradeId(wornItem.Owner); } diff --git a/Content.Server/Shuttles/EntitySystems/ShuttleSystem.cs b/Content.Server/Shuttles/EntitySystems/ShuttleSystem.cs index d7052f2851..2e8991ae70 100644 --- a/Content.Server/Shuttles/EntitySystems/ShuttleSystem.cs +++ b/Content.Server/Shuttles/EntitySystems/ShuttleSystem.cs @@ -2,6 +2,7 @@ using System.Collections.Generic; using Content.Server.Shuttles.Components; using JetBrains.Annotations; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Physics; namespace Content.Server.Shuttles.EntitySystems @@ -56,7 +57,7 @@ namespace Content.Server.Shuttles.EntitySystems private void OnShuttleStartup(EntityUid uid, ShuttleComponent component, ComponentStartup args) { - if (!component.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(component.Owner.Uid)) { return; } diff --git a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs index 2ef6034c0f..6c978b6ed8 100644 --- a/Content.Server/Singularity/EntitySystems/SingularitySystem.cs +++ b/Content.Server/Singularity/EntitySystems/SingularitySystem.cs @@ -102,10 +102,10 @@ namespace Content.Server.Singularity.EntitySystems private bool CanDestroy(SharedSingularityComponent component, IEntity entity) { return entity == component.Owner || - entity.HasComponent() || - entity.HasComponent() || - entity.HasComponent() || - entity.HasComponent(); + IoCManager.Resolve().HasComponent(entity.Uid) || + IoCManager.Resolve().HasComponent(entity.Uid) || + IoCManager.Resolve().HasComponent(entity.Uid) || + IoCManager.Resolve().HasComponent(entity.Uid); } private void HandleDestroy(ServerSingularityComponent component, IEntity entity) @@ -149,9 +149,9 @@ namespace Content.Server.Singularity.EntitySystems private bool CanPull(IEntity entity) { - return !(entity.HasComponent() || - entity.HasComponent() || - entity.HasComponent() || + return !(IoCManager.Resolve().HasComponent(entity.Uid) || + IoCManager.Resolve().HasComponent(entity.Uid) || + IoCManager.Resolve().HasComponent(entity.Uid) || entity.IsInContainer()); } diff --git a/Content.Server/Storage/Components/ServerStorageComponent.cs b/Content.Server/Storage/Components/ServerStorageComponent.cs index 30bb9d13a6..2f3886972a 100644 --- a/Content.Server/Storage/Components/ServerStorageComponent.cs +++ b/Content.Server/Storage/Components/ServerStorageComponent.cs @@ -531,7 +531,7 @@ namespace Content.Server.Storage.Components return false; Logger.DebugS(LoggerName, $"Storage (UID {Owner.Uid}) attacked by user (UID {eventArgs.User.Uid}) with entity (UID {eventArgs.Using.Uid})."); - if (Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(Owner.Uid)) { return false; } @@ -570,14 +570,14 @@ namespace Content.Server.Storage.Components // Pick up all entities in a radius around the clicked location. // The last half of the if is because carpets exist and this is terrible - if (_areaInsert && (eventArgs.Target == null || !eventArgs.Target.HasComponent())) + if (_areaInsert && (eventArgs.Target == null || !IoCManager.Resolve().HasComponent(eventArgs.Target.Uid))) { var validStorables = new List(); foreach (var entity in IoCManager.Resolve().GetEntitiesInRange(eventArgs.ClickLocation, _areaInsertRadius, LookupFlags.None)) { if (entity.IsInContainer() || entity == eventArgs.User - || !entity.HasComponent() + || !IoCManager.Resolve().HasComponent(entity.Uid) || !EntitySystem.Get().InRangeUnobstructed(eventArgs.User, entity)) continue; validStorables.Add(entity); @@ -605,7 +605,7 @@ namespace Content.Server.Storage.Components // Check again, situation may have changed for some entities, but we'll still pick up any that are valid if (entity.IsInContainer() || entity == eventArgs.User - || !entity.HasComponent()) + || !IoCManager.Resolve().HasComponent(entity.Uid)) continue; var position = EntityCoordinates.FromMap(Owner.Transform.Parent?.Owner ?? Owner, entity.Transform.MapPosition); if (PlayerInsertEntityInWorld(eventArgs.User, entity)) @@ -636,7 +636,7 @@ namespace Content.Server.Storage.Components if (eventArgs.Target == null || eventArgs.Target.IsInContainer() || eventArgs.Target == eventArgs.User - || !eventArgs.Target.HasComponent()) + || !IoCManager.Resolve().HasComponent(eventArgs.Target.Uid)) return false; var position = EntityCoordinates.FromMap(Owner.Transform.Parent?.Owner ?? Owner, eventArgs.Target.Transform.MapPosition); if (PlayerInsertEntityInWorld(eventArgs.User, eventArgs.Target)) diff --git a/Content.Server/Strip/StrippableComponent.cs b/Content.Server/Strip/StrippableComponent.cs index bf4707ae1d..3e24cc5f5e 100644 --- a/Content.Server/Strip/StrippableComponent.cs +++ b/Content.Server/Strip/StrippableComponent.cs @@ -133,7 +133,7 @@ namespace Content.Server.Strip { var owner = hands.GetItem(hand)?.Owner; - if (owner?.HasComponent() ?? true) + if ((owner != null ? IoCManager.Resolve().HasComponent(owner.Uid) : (bool?) null) ?? true) { dictionary[hand] = "None"; continue; @@ -359,7 +359,7 @@ namespace Content.Server.Strip return false; } - if (heldItem.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(heldItem.Owner.Uid)) return false; if (!hands.CanDrop(hand, false)) diff --git a/Content.Server/Throwing/ThrowHelper.cs b/Content.Server/Throwing/ThrowHelper.cs index f0dd22f780..9c0c1daa14 100644 --- a/Content.Server/Throwing/ThrowHelper.cs +++ b/Content.Server/Throwing/ThrowHelper.cs @@ -46,14 +46,14 @@ namespace Content.Server.Throwing return; } - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) { Logger.Warning("Throwing not supported for mobs!"); return; } var comp = entity.EnsureComponent(); - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) { comp.Thrower = user; // Give it a l'il spin. diff --git a/Content.Server/Traitor/Uplink/UplinkSystem.cs b/Content.Server/Traitor/Uplink/UplinkSystem.cs index b7a31c95e5..695cca2ef4 100644 --- a/Content.Server/Traitor/Uplink/UplinkSystem.cs +++ b/Content.Server/Traitor/Uplink/UplinkSystem.cs @@ -221,7 +221,7 @@ namespace Content.Server.Traitor.Uplink var heldItems = hands.GetAllHeldItems(); foreach (var item in heldItems) { - if (item.Owner.HasComponent()) + if (IoCManager.Resolve().HasComponent(item.Owner.Uid)) return item.Owner; } } diff --git a/Content.Server/Weapon/Ranged/Ammunition/Components/AmmoBoxComponent.cs b/Content.Server/Weapon/Ranged/Ammunition/Components/AmmoBoxComponent.cs index 43e3553516..e8a4c9592f 100644 --- a/Content.Server/Weapon/Ranged/Ammunition/Components/AmmoBoxComponent.cs +++ b/Content.Server/Weapon/Ranged/Ammunition/Components/AmmoBoxComponent.cs @@ -129,7 +129,7 @@ namespace Content.Server.Weapon.Ranged.Ammunition.Components async Task IInteractUsing.InteractUsing(InteractUsingEventArgs eventArgs) { - if (eventArgs.Using.HasComponent()) + if (IoCManager.Resolve().HasComponent(eventArgs.Using.Uid)) { return TryInsertAmmo(eventArgs.User, eventArgs.Using); } diff --git a/Content.Server/Weapon/Ranged/Barrels/BarrelSystem.cs b/Content.Server/Weapon/Ranged/Barrels/BarrelSystem.cs index 7c07749499..7c95bc382c 100644 --- a/Content.Server/Weapon/Ranged/Barrels/BarrelSystem.cs +++ b/Content.Server/Weapon/Ranged/Barrels/BarrelSystem.cs @@ -87,7 +87,7 @@ namespace Content.Server.Weapon.Ranged.Barrels !args.CanAccess || !args.CanInteract || component.PowerCell != null || - !args.Using.HasComponent() || + !IoCManager.Resolve().HasComponent(args.Using.Uid) || !_actionBlockerSystem.CanDrop(args.User.Uid)) return; diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs index 4e63f13a12..f69b0da36a 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerBatteryBarrelComponent.cs @@ -206,7 +206,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components return false; } - if (!entity.HasComponent()) + if (!IoCManager.Resolve().HasComponent(entity.Uid)) { return false; } @@ -267,7 +267,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components public override async Task InteractUsing(InteractUsingEventArgs eventArgs) { - if (!eventArgs.Using.HasComponent()) + if (!IoCManager.Resolve().HasComponent(eventArgs.Using.Uid)) { return false; } diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs index fd7cb2aba2..19dd2d9e85 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs @@ -225,7 +225,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components { FireHitscan(shooter, hitscan, angle); } - else if (projectile.HasComponent() && + else if (IoCManager.Resolve().HasComponent(projectile.Uid) && ammo != null && ammo.TryGetComponent(out AmmoComponent? ammoComponent)) { diff --git a/Content.Shared/Buckle/Components/SharedBuckleComponent.cs b/Content.Shared/Buckle/Components/SharedBuckleComponent.cs index c74ab61476..0d0d09491c 100644 --- a/Content.Shared/Buckle/Components/SharedBuckleComponent.cs +++ b/Content.Shared/Buckle/Components/SharedBuckleComponent.cs @@ -3,6 +3,7 @@ using Content.Shared.DragDrop; using Content.Shared.Interaction; using Robust.Shared.GameObjects; using Robust.Shared.GameStates; +using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -36,7 +37,7 @@ namespace Content.Shared.Buckle.Components bool IDraggable.CanDrop(CanDropEvent args) { - return args.Target.HasComponent(); + return IoCManager.Resolve().HasComponent(args.Target.Uid); } bool IDraggable.Drop(DragDropEvent args) diff --git a/Content.Shared/Climbing/SharedClimbableComponent.cs b/Content.Shared/Climbing/SharedClimbableComponent.cs index b27b44dc93..cec067707e 100644 --- a/Content.Shared/Climbing/SharedClimbableComponent.cs +++ b/Content.Shared/Climbing/SharedClimbableComponent.cs @@ -1,6 +1,7 @@ using Content.Shared.DragDrop; using Content.Shared.Interaction; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -19,7 +20,7 @@ namespace Content.Shared.Climbing public virtual bool CanDragDropOn(DragDropEvent eventArgs) { - return eventArgs.Dragged.HasComponent(); + return IoCManager.Resolve().HasComponent(eventArgs.Dragged.Uid); } public abstract bool DragDropOn(DragDropEvent eventArgs); diff --git a/Content.Shared/Construction/Conditions/EmptyOrWindowValidInTile.cs b/Content.Shared/Construction/Conditions/EmptyOrWindowValidInTile.cs index cce825c205..3ae356117d 100644 --- a/Content.Shared/Construction/Conditions/EmptyOrWindowValidInTile.cs +++ b/Content.Shared/Construction/Conditions/EmptyOrWindowValidInTile.cs @@ -3,6 +3,7 @@ using Content.Shared.Maps; using Content.Shared.Window; using JetBrains.Annotations; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization.Manager.Attributes; @@ -22,7 +23,7 @@ namespace Content.Shared.Construction.Conditions foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.IncludeAnchored)) { - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) result = true; } diff --git a/Content.Shared/Construction/Conditions/NoWindowsInTile.cs b/Content.Shared/Construction/Conditions/NoWindowsInTile.cs index 72a6e13981..f2ee536ccd 100644 --- a/Content.Shared/Construction/Conditions/NoWindowsInTile.cs +++ b/Content.Shared/Construction/Conditions/NoWindowsInTile.cs @@ -2,6 +2,7 @@ using Content.Shared.Window; using JetBrains.Annotations; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Serialization.Manager.Attributes; @@ -16,7 +17,7 @@ namespace Content.Shared.Construction.Conditions { foreach (var entity in location.GetEntitiesInTile(LookupFlags.Approximate | LookupFlags.IncludeAnchored)) { - if (entity.HasComponent()) + if (IoCManager.Resolve().HasComponent(entity.Uid)) return false; } diff --git a/Content.Shared/Disposal/SharedDisposalUnitSystem.cs b/Content.Shared/Disposal/SharedDisposalUnitSystem.cs index 8452994613..98adba3299 100644 --- a/Content.Shared/Disposal/SharedDisposalUnitSystem.cs +++ b/Content.Shared/Disposal/SharedDisposalUnitSystem.cs @@ -54,7 +54,7 @@ namespace Content.Shared.Disposal // TODO: Probably just need a disposable tag. if (!entity.TryGetComponent(out SharedItemComponent? storable) && - !entity.HasComponent()) + !IoCManager.Resolve().HasComponent(entity.Uid)) { return false; } diff --git a/Content.Shared/Kitchen/Components/SharedKitchenSpikeComponent.cs b/Content.Shared/Kitchen/Components/SharedKitchenSpikeComponent.cs index 3649fdf8c9..11dc6f691f 100644 --- a/Content.Shared/Kitchen/Components/SharedKitchenSpikeComponent.cs +++ b/Content.Shared/Kitchen/Components/SharedKitchenSpikeComponent.cs @@ -3,6 +3,7 @@ using Content.Shared.DragDrop; using Content.Shared.Nutrition.Components; using Content.Shared.Sound; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.ViewVariables; @@ -23,7 +24,7 @@ namespace Content.Shared.Kitchen.Components bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) { - if (!eventArgs.Dragged.HasComponent()) + if (!IoCManager.Resolve().HasComponent(eventArgs.Dragged.Uid)) { return false; } diff --git a/Content.Shared/MedicalScanner/SharedMedicalScannerComponent.cs b/Content.Shared/MedicalScanner/SharedMedicalScannerComponent.cs index e3621fb936..0541357fe6 100644 --- a/Content.Shared/MedicalScanner/SharedMedicalScannerComponent.cs +++ b/Content.Shared/MedicalScanner/SharedMedicalScannerComponent.cs @@ -5,6 +5,7 @@ using Content.Shared.Damage; using Content.Shared.DragDrop; using Content.Shared.FixedPoint; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; namespace Content.Shared.MedicalScanner @@ -80,7 +81,7 @@ namespace Content.Shared.MedicalScanner public bool CanInsert(IEntity entity) { - return entity.HasComponent(); + return IoCManager.Resolve().HasComponent(entity.Uid); } bool IDragDropOn.CanDragDropOn(DragDropEvent eventArgs) diff --git a/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs b/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs index 7326602f59..e8baaa177f 100644 --- a/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs +++ b/Content.Shared/Movement/Components/MovementIgnoreGravityComponent.cs @@ -19,7 +19,7 @@ namespace Content.Shared.Movement.Components if (body == null) entity.TryGetComponent(out body); - if (entity.HasComponent() || + if (IoCManager.Resolve().HasComponent(entity.Uid) || (body?.BodyType & (BodyType.Static | BodyType.Kinematic)) != 0) return false; var transform = entity.Transform; diff --git a/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs b/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs index 98c0952651..3a61bcad49 100644 --- a/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs +++ b/Content.Shared/Movement/Components/SharedPlayerMobMoverComponent.cs @@ -1,6 +1,7 @@ using System; using Robust.Shared.GameObjects; using Robust.Shared.GameStates; +using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Maths; using Robust.Shared.Players; @@ -85,7 +86,7 @@ namespace Content.Shared.Movement.Components protected override void Initialize() { base.Initialize(); - if (!Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(Owner.Uid)) { Owner.EnsureComponentWarn(); } diff --git a/Content.Shared/Movement/SharedMoverController.cs b/Content.Shared/Movement/SharedMoverController.cs index 13e71a3f9f..00effb7edd 100644 --- a/Content.Shared/Movement/SharedMoverController.cs +++ b/Content.Shared/Movement/SharedMoverController.cs @@ -164,7 +164,7 @@ namespace Content.Shared.Movement protected bool UseMobMovement(PhysicsComponent body) { return body.BodyStatus == BodyStatus.OnGround && - body.Owner.HasComponent() && + IoCManager.Resolve().HasComponent(body.Owner.Uid) && // If we're being pulled then don't mess with our velocity. (!body.Owner.TryGetComponent(out SharedPullableComponent? pullable) || !pullable.BeingPulled) && _blocker.CanMove(body.OwnerUid); diff --git a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs index b7e56a6442..966d2b817c 100644 --- a/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs +++ b/Content.Shared/Pulling/Systems/SharedPullingSystem.Actions.cs @@ -29,7 +29,7 @@ namespace Content.Shared.Pulling public bool CanPull(IEntity puller, IEntity pulled) { - if (!puller.HasComponent()) + if (!IoCManager.Resolve().HasComponent(puller.Uid)) { return false; } @@ -198,7 +198,7 @@ namespace Content.Shared.Pulling return false; } - if (!pullable.Owner.HasComponent()) + if (!IoCManager.Resolve().HasComponent(pullable.Owner.Uid)) { return false; } diff --git a/Content.Shared/Singularity/SharedSingularitySystem.cs b/Content.Shared/Singularity/SharedSingularitySystem.cs index dbb4fe4921..fcf2b71a57 100644 --- a/Content.Shared/Singularity/SharedSingularitySystem.cs +++ b/Content.Shared/Singularity/SharedSingularitySystem.cs @@ -102,8 +102,8 @@ namespace Content.Shared.Singularity { var other = args.BodyB.Owner; - if ((!other.HasComponent() && - !other.HasComponent()) || + if ((!IoCManager.Resolve().HasComponent(other.Uid) && + !IoCManager.Resolve().HasComponent(other.Uid)) || component.Level >= 4) { args.Cancel(); diff --git a/Content.Shared/Strip/Components/SharedStrippableComponent.cs b/Content.Shared/Strip/Components/SharedStrippableComponent.cs index ab369ede20..774e46da7e 100644 --- a/Content.Shared/Strip/Components/SharedStrippableComponent.cs +++ b/Content.Shared/Strip/Components/SharedStrippableComponent.cs @@ -4,6 +4,7 @@ using Content.Shared.ActionBlocker; using Content.Shared.DragDrop; using Content.Shared.Hands.Components; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Serialization; using static Content.Shared.Inventory.EquipmentSlotDefines; @@ -16,7 +17,7 @@ namespace Content.Shared.Strip.Components public bool CanBeStripped(IEntity by) { return by != Owner - && by.HasComponent() + && IoCManager.Resolve().HasComponent(@by.Uid) && EntitySystem.Get().CanInteract(by.Uid); } diff --git a/Content.Shared/Tabletop/SharedTabletopSystem.cs b/Content.Shared/Tabletop/SharedTabletopSystem.cs index 3e395a1543..12956a9baf 100644 --- a/Content.Shared/Tabletop/SharedTabletopSystem.cs +++ b/Content.Shared/Tabletop/SharedTabletopSystem.cs @@ -44,7 +44,7 @@ namespace Content.Shared.Tabletop return false; } - if (!parent.HasComponent() && !parent.HasComponent()) + if (!IoCManager.Resolve().HasComponent(parent.Uid) && !IoCManager.Resolve().HasComponent(parent.Uid)) { return false; } diff --git a/Content.Shared/Throwing/ThrownItemSystem.cs b/Content.Shared/Throwing/ThrownItemSystem.cs index b880f3e0b2..f81c67aa52 100644 --- a/Content.Shared/Throwing/ThrownItemSystem.cs +++ b/Content.Shared/Throwing/ThrownItemSystem.cs @@ -119,7 +119,7 @@ namespace Content.Shared.Throwing // Unfortunately we can't check for hands containers as they have specific names. if (thrownItem.Owner.TryGetContainerMan(out var containerManager) && - containerManager.Owner.HasComponent()) + IoCManager.Resolve().HasComponent(containerManager.Owner.Uid)) { EntityManager.RemoveComponent(landing.Uid, thrownItem); return;