diff --git a/Content.Client/Animations/ReusableAnimations.cs b/Content.Client/Animations/ReusableAnimations.cs index f25ba07a75..8326c5feb4 100644 --- a/Content.Client/Animations/ReusableAnimations.cs +++ b/Content.Client/Animations/ReusableAnimations.cs @@ -27,7 +27,7 @@ namespace Content.Client.Animations var animations = animatableClone.GetComponent(); animations.AnimationCompleted += (_) => { - animatableClone.Delete(); + IoCManager.Resolve().DeleteEntity(animatableClone.Uid); }; animations.Play(new Animation diff --git a/Content.Client/Items/UI/ItemSlotButton.cs b/Content.Client/Items/UI/ItemSlotButton.cs index 201fa28f5c..928c98f551 100644 --- a/Content.Client/Items/UI/ItemSlotButton.cs +++ b/Content.Client/Items/UI/ItemSlotButton.cs @@ -2,6 +2,7 @@ using Content.Client.Cooldown; using Content.Client.Items.Managers; using Content.Client.Stylesheets; +using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Client.UserInterface; using Robust.Client.UserInterface.Controls; @@ -138,7 +139,12 @@ namespace Content.Client.Items.UI { if (EntityHover) { - HoverSpriteView.Sprite?.Owner.Delete(); + ISpriteComponent? tempQualifier = HoverSpriteView.Sprite; + if (tempQualifier != null) + { + IoCManager.Resolve().DeleteEntity(tempQualifier.Owner.Uid); + } + HoverSpriteView.Sprite = null; } } diff --git a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs index 5bc657ae09..731271dba0 100644 --- a/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs +++ b/Content.Client/Lobby/UI/LobbyCharacterPreviewPanel.cs @@ -98,7 +98,7 @@ namespace Content.Client.Lobby.UI _preferencesManager.OnServerDataLoaded -= UpdateUI; if (!disposing) return; - _previewDummy.Delete(); + IoCManager.Resolve().DeleteEntity(_previewDummy.Uid); _previewDummy = null!; } @@ -160,7 +160,7 @@ namespace Content.Client.Lobby.UI { var item = entityMan.SpawnEntity(itemType, MapCoordinates.Nullspace); inventory.SetSlotVisuals(slot, item); - item.Delete(); + IoCManager.Resolve().DeleteEntity(item.Uid); } } } diff --git a/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs b/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs index f8ff373a54..318df59db5 100644 --- a/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs +++ b/Content.Client/Preferences/UI/CharacterSetupGui.xaml.cs @@ -218,7 +218,7 @@ namespace Content.Client.Preferences.UI if (!disposing) return; - _previewDummy.Delete(); + IoCManager.Resolve().DeleteEntity(_previewDummy.Uid); _previewDummy = null!; } } diff --git a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs index 6b91912867..9b4467ec3b 100644 --- a/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs +++ b/Content.Client/Preferences/UI/HumanoidProfileEditor.xaml.cs @@ -482,7 +482,7 @@ namespace Content.Client.Preferences.UI if (!disposing) return; - _previewDummy.Delete(); + IoCManager.Resolve().DeleteEntity(_previewDummy.Uid); _preferencesManager.OnServerDataLoaded -= LoadServerData; } diff --git a/Content.Client/Wall/Components/LowWallComponent.cs b/Content.Client/Wall/Components/LowWallComponent.cs index 2eda861800..5f41e63fd8 100644 --- a/Content.Client/Wall/Components/LowWallComponent.cs +++ b/Content.Client/Wall/Components/LowWallComponent.cs @@ -63,7 +63,11 @@ namespace Content.Client.Wall.Components { base.Shutdown(); - _overlayEntity?.Delete(); + IEntity? tempQualifier = _overlayEntity; + if (tempQualifier != null) + { + IoCManager.Resolve().DeleteEntity(tempQualifier.Uid); + } } internal override void CalculateNewSprite() diff --git a/Content.Client/Weapons/Melee/Components/MeleeWeaponArcAnimationComponent.cs b/Content.Client/Weapons/Melee/Components/MeleeWeaponArcAnimationComponent.cs index 9f5863458f..4502c1c424 100644 --- a/Content.Client/Weapons/Melee/Components/MeleeWeaponArcAnimationComponent.cs +++ b/Content.Client/Weapons/Melee/Components/MeleeWeaponArcAnimationComponent.cs @@ -2,6 +2,7 @@ using Content.Shared.Weapons.Melee; using Robust.Client.GameObjects; using Robust.Client.Graphics; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Maths; namespace Content.Client.Weapons.Melee.Components @@ -71,7 +72,7 @@ namespace Content.Client.Weapons.Melee.Components if (_meleeWeaponAnimation.Length.TotalSeconds <= _timer) { - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); } } } diff --git a/Content.IntegrationTests/Tests/DeleteInventoryTest.cs b/Content.IntegrationTests/Tests/DeleteInventoryTest.cs index 62e65fe009..ec4641929a 100644 --- a/Content.IntegrationTests/Tests/DeleteInventoryTest.cs +++ b/Content.IntegrationTests/Tests/DeleteInventoryTest.cs @@ -38,7 +38,7 @@ namespace Content.IntegrationTests.Tests Assert.That(inv.Equip(Slots.HEAD, item, false), Is.True); // Delete parent. - container.Delete(); + IoCManager.Resolve().DeleteEntity(container.Uid); // Assert that child item was also deleted. Assert.That(item.Deleted, Is.True); diff --git a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs index 23689f7c8c..c9016c5cbf 100644 --- a/Content.IntegrationTests/Tests/Doors/AirlockTest.cs +++ b/Content.IntegrationTests/Tests/Doors/AirlockTest.cs @@ -4,6 +4,7 @@ using Content.Server.Doors.Components; using Content.Shared.Doors; using NUnit.Framework; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Map; using Robust.Shared.Physics; @@ -96,7 +97,7 @@ namespace Content.IntegrationTests.Tests.Doors { Assert.DoesNotThrow(() => { - airlock.Delete(); + IoCManager.Resolve().DeleteEntity(airlock.Uid); }); }); diff --git a/Content.IntegrationTests/Tests/MindEntityDeletionTest.cs b/Content.IntegrationTests/Tests/MindEntityDeletionTest.cs index edfa665574..c8f80787b4 100644 --- a/Content.IntegrationTests/Tests/MindEntityDeletionTest.cs +++ b/Content.IntegrationTests/Tests/MindEntityDeletionTest.cs @@ -49,12 +49,12 @@ namespace Content.IntegrationTests.Tests server.Assert(() => { - visitEnt.Delete(); + IoCManager.Resolve().DeleteEntity(visitEnt.Uid); Assert.That(mind.VisitingEntity, Is.Null); // This used to throw so make sure it doesn't. - playerEnt.Delete(); + IoCManager.Resolve().DeleteEntity(playerEnt.Uid); }); await server.WaitIdleAsync(); @@ -91,7 +91,7 @@ namespace Content.IntegrationTests.Tests server.Post(() => { - playerEnt.Delete(); + IoCManager.Resolve().DeleteEntity(playerEnt.Uid); }); server.RunTicks(1); diff --git a/Content.Server/Actions/Spells/GiveItemSpell.cs b/Content.Server/Actions/Spells/GiveItemSpell.cs index 6168d20d6d..9d1eb142eb 100644 --- a/Content.Server/Actions/Spells/GiveItemSpell.cs +++ b/Content.Server/Actions/Spells/GiveItemSpell.cs @@ -57,7 +57,7 @@ namespace Content.Server.Actions.Spells if (!spawnedProto.TryGetComponent(out ItemComponent? itemComponent)) { Logger.Error($"Tried to use {nameof(GiveItemSpell)} but prototype has no {nameof(ItemComponent)}?"); - spawnedProto.Delete(); + IoCManager.Resolve().DeleteEntity(spawnedProto.Uid); return; } diff --git a/Content.Server/Administration/AdminVerbSystem.cs b/Content.Server/Administration/AdminVerbSystem.cs index 1d3d16569c..aee89477d1 100644 --- a/Content.Server/Administration/AdminVerbSystem.cs +++ b/Content.Server/Administration/AdminVerbSystem.cs @@ -68,7 +68,7 @@ namespace Content.Server.Administration verb.Text = Loc.GetString("delete-verb-get-data-text"); verb.Category = VerbCategory.Debug; verb.IconTexture = "/Textures/Interface/VerbIcons/delete_transparent.svg.192dpi.png"; - verb.Act = () => args.Target.Delete(); + verb.Act = () => IoCManager.Resolve().DeleteEntity(args.Target.Uid); verb.Impact = LogImpact.Medium; args.Verbs.Add(verb); } diff --git a/Content.Server/Administration/Commands/DeleteEntitiesWithComponent.cs b/Content.Server/Administration/Commands/DeleteEntitiesWithComponent.cs index f2fff25edd..b5b838007d 100644 --- a/Content.Server/Administration/Commands/DeleteEntitiesWithComponent.cs +++ b/Content.Server/Administration/Commands/DeleteEntitiesWithComponent.cs @@ -42,7 +42,7 @@ namespace Content.Server.Administration.Commands var count = 0; foreach (var entity in entitiesWithAllComponents) { - entity.Delete(); + IoCManager.Resolve().DeleteEntity(entity.Uid); count += 1; } diff --git a/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs b/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs index 0cc0eda009..a63cc4bec5 100644 --- a/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs +++ b/Content.Server/Administration/Commands/DeleteEntitiesWithId.cs @@ -29,7 +29,7 @@ namespace Content.Server.Administration.Commands foreach (var entity in entities) { - entity.Delete(); + IoCManager.Resolve().DeleteEntity(entity.Uid); i++; } diff --git a/Content.Server/Administration/Commands/DeleteEntityCommand.cs b/Content.Server/Administration/Commands/DeleteEntityCommand.cs index d6e2815f05..d87af342bc 100644 --- a/Content.Server/Administration/Commands/DeleteEntityCommand.cs +++ b/Content.Server/Administration/Commands/DeleteEntityCommand.cs @@ -34,7 +34,7 @@ namespace Content.Server.Administration.Commands return; } - entity.Delete(); + IoCManager.Resolve().DeleteEntity(entity.Uid); shell.WriteLine($"Deleted entity with id {id}."); } } diff --git a/Content.Server/Chemistry/Components/SmokeSolutionAreaEffectComponent.cs b/Content.Server/Chemistry/Components/SmokeSolutionAreaEffectComponent.cs index 2711e41586..76b23cfa32 100644 --- a/Content.Server/Chemistry/Components/SmokeSolutionAreaEffectComponent.cs +++ b/Content.Server/Chemistry/Components/SmokeSolutionAreaEffectComponent.cs @@ -58,7 +58,7 @@ namespace Content.Server.Chemistry.Components { if ((!IoCManager.Resolve().EntityExists(Owner.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve().GetComponent(Owner.Uid).EntityLifeStage) >= EntityLifeStage.Deleted) return; - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); } } } diff --git a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs index 149da7042d..729107cafb 100644 --- a/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs +++ b/Content.Server/Chemistry/Components/SolutionAreaEffectComponent.cs @@ -87,7 +87,7 @@ namespace Content.Server.Chemistry.Components if (!newEffect.TryGetComponent(out SolutionAreaEffectComponent? effectComponent)) { - newEffect.Delete(); + IoCManager.Resolve().DeleteEntity(newEffect.Uid); return; } diff --git a/Content.Server/Construction/Completions/BuildComputer.cs b/Content.Server/Construction/Completions/BuildComputer.cs index fdf7d6c134..2cab2e7674 100644 --- a/Content.Server/Construction/Completions/BuildComputer.cs +++ b/Content.Server/Construction/Completions/BuildComputer.cs @@ -6,6 +6,7 @@ using JetBrains.Annotations; using Robust.Server.Containers; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Serialization.Manager.Attributes; @@ -58,7 +59,7 @@ namespace Content.Server.Construction.Completions foreach (var ent in computerContainer.ContainedEntities.ToArray()) { computerContainer.ForceRemove(ent); - ent.Delete(); + IoCManager.Resolve().DeleteEntity(ent.Uid); } computerContainer.Insert(board); diff --git a/Content.Server/Construction/Components/WelderRefinableComponent.cs b/Content.Server/Construction/Components/WelderRefinableComponent.cs index 68381d6dff..1347dd0162 100644 --- a/Content.Server/Construction/Components/WelderRefinableComponent.cs +++ b/Content.Server/Construction/Components/WelderRefinableComponent.cs @@ -61,7 +61,7 @@ namespace Content.Server.Construction.Components // get last owner coordinates and delete it var resultPosition = Owner.Transform.Coordinates; - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); // spawn each result after refine foreach (var result in _refineResult!) diff --git a/Content.Server/Engineering/EntitySystems/DisassembleOnActivateSystem.cs b/Content.Server/Engineering/EntitySystems/DisassembleOnActivateSystem.cs index 2491d4e8b7..3f92c21c58 100644 --- a/Content.Server/Engineering/EntitySystems/DisassembleOnActivateSystem.cs +++ b/Content.Server/Engineering/EntitySystems/DisassembleOnActivateSystem.cs @@ -52,7 +52,7 @@ namespace Content.Server.Engineering.EntitySystems hands.PutInHandOrDrop(item); } - component.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(component.Owner.Uid); return; } diff --git a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs index d231f103bd..592bf018dc 100644 --- a/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs +++ b/Content.Server/Engineering/EntitySystems/SpawnAfterInteractSystem.cs @@ -69,7 +69,7 @@ namespace Content.Server.Engineering.EntitySystems EntityManager.SpawnEntity(component.Prototype, args.ClickLocation.SnapToGrid(grid)); if (component.RemoveOnInteract && stackComp == null && !((!IoCManager.Resolve().EntityExists(component.Owner.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve().GetComponent(component.Owner.Uid).EntityLifeStage) >= EntityLifeStage.Deleted)) - component.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(component.Owner.Uid); } } } diff --git a/Content.Server/Explosion/Components/ClusterFlashComponent.cs b/Content.Server/Explosion/Components/ClusterFlashComponent.cs index 0409d3209b..cbc43c540e 100644 --- a/Content.Server/Explosion/Components/ClusterFlashComponent.cs +++ b/Content.Server/Explosion/Components/ClusterFlashComponent.cs @@ -123,7 +123,7 @@ namespace Content.Server.Explosion.Components }); } - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); }); return true; } diff --git a/Content.Server/Fluids/Components/MopComponent.cs b/Content.Server/Fluids/Components/MopComponent.cs index aa65b4f5ae..19e2cc80b9 100644 --- a/Content.Server/Fluids/Components/MopComponent.cs +++ b/Content.Server/Fluids/Components/MopComponent.cs @@ -143,7 +143,7 @@ namespace Content.Server.Fluids.Components // is the puddle cleaned? if (puddleSolution.TotalVolume - transferAmount <= 0) { - puddleComponent.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(puddleComponent.Owner.Uid); // After cleaning the puddle, make a new puddle with solution from the mop as a "wet floor". Then evaporate it slowly. // we do this WITHOUT adding to the existing puddle. Otherwise we have might have water puddles with the vomit sprite. diff --git a/Content.Server/GameTicking/GameTicker.RoundFlow.cs b/Content.Server/GameTicking/GameTicker.RoundFlow.cs index 87d1f657c5..e8bac90211 100644 --- a/Content.Server/GameTicking/GameTicker.RoundFlow.cs +++ b/Content.Server/GameTicking/GameTicker.RoundFlow.cs @@ -363,7 +363,7 @@ namespace Content.Server.GameTicking { // TODO: Maybe something less naive here? // FIXME: Actually, definitely. - entity.Delete(); + IoCManager.Resolve().DeleteEntity(entity.Uid); } _mapManager.Restart(); diff --git a/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs b/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs index ed337d1088..61fc73c421 100644 --- a/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs +++ b/Content.Server/GameTicking/Presets/PresetTraitorDeathMatch.cs @@ -86,7 +86,7 @@ namespace Content.Server.GameTicking.Presets foreach (var slot in victimSlots) { if (inventory.TryGetSlotItem(slot, out ItemComponent? vItem)) - vItem.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(vItem.Owner.Uid); } // Replace their items: diff --git a/Content.Server/Ghost/GhostSystem.cs b/Content.Server/Ghost/GhostSystem.cs index 41f692c82f..b6fe399e49 100644 --- a/Content.Server/Ghost/GhostSystem.cs +++ b/Content.Server/Ghost/GhostSystem.cs @@ -187,7 +187,7 @@ namespace Content.Server.Ghost if (entity.TryGetComponent(out var mind)) mind.GhostOnShutdown = false; - entity.Delete(); + IoCManager.Resolve().DeleteEntity(entity.Uid); } private IEnumerable GetLocationNames() diff --git a/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs b/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs index 8042108297..2d9e36ad08 100644 --- a/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs +++ b/Content.Server/Ghost/Roles/Components/GhostRoleMobSpawnerComponent.cs @@ -58,7 +58,7 @@ namespace Content.Server.Ghost.Roles.Components Taken = true; if (_deleteOnSpawn) - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); return true; } diff --git a/Content.Server/Hands/Systems/HandsSystem.cs b/Content.Server/Hands/Systems/HandsSystem.cs index 6c2c10156f..8cb5397ecd 100644 --- a/Content.Server/Hands/Systems/HandsSystem.cs +++ b/Content.Server/Hands/Systems/HandsSystem.cs @@ -89,7 +89,7 @@ namespace Content.Server.Hands.Systems || virtualItem.BlockingEntity != args.Pulled.Owner.Uid) continue; - hand.HeldEntity.Delete(); + IoCManager.Resolve().DeleteEntity(hand.HeldEntity.Uid); break; } } diff --git a/Content.Server/Inventory/Components/InventoryComponent.cs b/Content.Server/Inventory/Components/InventoryComponent.cs index 551f21ec5b..4a412324d8 100644 --- a/Content.Server/Inventory/Components/InventoryComponent.cs +++ b/Content.Server/Inventory/Components/InventoryComponent.cs @@ -69,7 +69,7 @@ namespace Content.Server.Inventory.Components { if (TryGetSlotItem(slot, out ItemComponent? item)) { - item.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(item.Owner.Uid); } RemoveSlot(slot); diff --git a/Content.Server/Inventory/InventoryHelpers.cs b/Content.Server/Inventory/InventoryHelpers.cs index ca120e9830..7b88f50f43 100644 --- a/Content.Server/Inventory/InventoryHelpers.cs +++ b/Content.Server/Inventory/InventoryHelpers.cs @@ -33,7 +33,7 @@ namespace Content.Server.Inventory // Helper method that deletes the item and returns false. bool DeleteItem() { - item.Delete(); + IoCManager.Resolve().DeleteEntity(item.Uid); return false; } diff --git a/Content.Server/Kitchen/Components/KitchenSpikeComponent.cs b/Content.Server/Kitchen/Components/KitchenSpikeComponent.cs index c0bd432b64..411ecaa68f 100644 --- a/Content.Server/Kitchen/Components/KitchenSpikeComponent.cs +++ b/Content.Server/Kitchen/Components/KitchenSpikeComponent.cs @@ -154,7 +154,7 @@ namespace Content.Server.Kitchen.Components Owner.PopupMessageEveryone(Loc.GetString("comp-kitchen-spike-kill", ("user", user), ("victim", victim))); // TODO: Need to be able to leave them on the spike to do DoT, see ss13. - victim.Delete(); + IoCManager.Resolve().DeleteEntity(victim.Uid); SoundSystem.Play(Filter.Pvs(Owner), SpikeSound.GetSound(), Owner); } diff --git a/Content.Server/Kitchen/Components/MicrowaveComponent.cs b/Content.Server/Kitchen/Components/MicrowaveComponent.cs index 9a54f4ad83..27e49efacd 100644 --- a/Content.Server/Kitchen/Components/MicrowaveComponent.cs +++ b/Content.Server/Kitchen/Components/MicrowaveComponent.cs @@ -411,7 +411,7 @@ namespace Content.Server.Kitchen.Components { var item = _storage.ContainedEntities.ElementAt(i); _storage.Remove(item); - item.Delete(); + IoCManager.Resolve().DeleteEntity(item.Uid); } } @@ -459,7 +459,7 @@ namespace Content.Server.Kitchen.Components if (IoCManager.Resolve().GetComponent(item.Uid).EntityPrototype.ID == recipeSolid.Key) { _storage.Remove(item); - item.Delete(); + IoCManager.Resolve().DeleteEntity(item.Uid); break; } } diff --git a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs index 4da12644d6..1237f14fb6 100644 --- a/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs +++ b/Content.Server/Kitchen/EntitySystems/ReagentGrinderSystem.cs @@ -319,7 +319,7 @@ namespace Content.Server.Kitchen.EntitySystems solution.ScaleSolution(juiceEvent.Scalar); _solutionsSystem.TryAddSolution(beakerEntity.Uid, component.HeldBeaker, solution); _solutionsSystem.RemoveAllSolution(beakerEntity.Uid, solution); - item.Delete(); + IoCManager.Resolve().DeleteEntity(item.Uid); } component.Busy = false; @@ -351,7 +351,7 @@ namespace Content.Server.Kitchen.EntitySystems component.HeldBeaker.MaxVolume) continue; juiceMe.JuiceSolution.ScaleSolution(juiceEvent.Scalar); _solutionsSystem.TryAddSolution(beakerEntity.Uid, component.HeldBeaker, juiceMe.JuiceSolution); - item.Delete(); + IoCManager.Resolve().DeleteEntity(item.Uid); } bui?.SendMessage(new SharedReagentGrinderComponent.ReagentGrinderWorkCompleteMessage()); diff --git a/Content.Server/Lathe/Components/LatheComponent.cs b/Content.Server/Lathe/Components/LatheComponent.cs index e0f84228f0..2e689757ef 100644 --- a/Content.Server/Lathe/Components/LatheComponent.cs +++ b/Content.Server/Lathe/Components/LatheComponent.cs @@ -202,7 +202,7 @@ namespace Content.Server.Lathe.Components SetAppearance(LatheVisualState.Idle); }); - eventArgs.Using.Delete(); + IoCManager.Resolve().DeleteEntity(eventArgs.Using.Uid); return true; } diff --git a/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs b/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs index 96ba413a93..ab4e34a90e 100644 --- a/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs +++ b/Content.Server/Morgue/Components/CrematoriumEntityStorageComponent.cs @@ -117,7 +117,7 @@ namespace Content.Server.Morgue.Components { var item = Contents.ContainedEntities[i]; Contents.Remove(item); - item.Delete(); + IoCManager.Resolve().DeleteEntity(item.Uid); } var ash = IoCManager.Resolve().SpawnEntity("Ash", Owner.Transform.Coordinates); @@ -148,7 +148,7 @@ namespace Content.Server.Morgue.Components } else { - victim.Delete(); + IoCManager.Resolve().DeleteEntity(victim.Uid); } Cremate(); diff --git a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs index a129363b00..6bb33d17a3 100644 --- a/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs +++ b/Content.Server/Nutrition/EntitySystems/UtensilSystem.cs @@ -70,7 +70,7 @@ namespace Content.Server.Nutrition.EntitySystems if (_robustRandom.Prob(component.BreakChance)) { SoundSystem.Play(Filter.Pvs(userUid), component.BreakSound.GetSound(), userUid, AudioParams.Default.WithVolume(-2f)); - component.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(component.Owner.Uid); } } } diff --git a/Content.Server/ParticleAccelerator/Components/ParticleProjectileComponent.cs b/Content.Server/ParticleAccelerator/Components/ParticleProjectileComponent.cs index b49a0f2b2a..8200f9d858 100644 --- a/Content.Server/ParticleAccelerator/Components/ParticleProjectileComponent.cs +++ b/Content.Server/ParticleAccelerator/Components/ParticleProjectileComponent.cs @@ -3,6 +3,7 @@ using Content.Server.Singularity.Components; using Content.Shared.Singularity.Components; using Robust.Server.GameObjects; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Log; using Robust.Shared.Maths; using Robust.Shared.Physics.Collision; @@ -71,7 +72,7 @@ namespace Content.Server.ParticleAccelerator.Components .LinearVelocity = angle.ToWorldVec() * 20f; Owner.Transform.LocalRotation = angle; - Timer.Spawn(3000, () => Owner.Delete()); + Timer.Spawn(3000, () => IoCManager.Resolve().DeleteEntity(Owner.Uid)); } } } diff --git a/Content.Server/Pointing/Components/PointingArrowComponent.cs b/Content.Server/Pointing/Components/PointingArrowComponent.cs index 2dc10ad800..d38499f44c 100644 --- a/Content.Server/Pointing/Components/PointingArrowComponent.cs +++ b/Content.Server/Pointing/Components/PointingArrowComponent.cs @@ -81,7 +81,7 @@ namespace Content.Server.Pointing.Components return; } - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); return; } diff --git a/Content.Server/Power/Components/CableComponent.cs b/Content.Server/Power/Components/CableComponent.cs index 45c5f679d8..73a0564dc2 100644 --- a/Content.Server/Power/Components/CableComponent.cs +++ b/Content.Server/Power/Components/CableComponent.cs @@ -47,7 +47,7 @@ namespace Content.Server.Power.Components if (EntitySystem.Get().TryDoElectrifiedAct(Owner.Uid, eventArgs.User.Uid)) return false; - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); var droppedEnt = IoCManager.Resolve().SpawnEntity(_cableDroppedOnCutPrototype, eventArgs.ClickLocation); // TODO: Literally just use a prototype that has a single thing in the stack, it's not that complicated... diff --git a/Content.Server/PowerCell/Components/PowerCellComponent.cs b/Content.Server/PowerCell/Components/PowerCellComponent.cs index 4603d11b68..0da339dec3 100644 --- a/Content.Server/PowerCell/Components/PowerCellComponent.cs +++ b/Content.Server/PowerCell/Components/PowerCellComponent.cs @@ -5,6 +5,7 @@ using Content.Shared.Examine; using Content.Shared.PowerCell; using Content.Shared.Rounding; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Localization; using Robust.Shared.Serialization.Manager.Attributes; using Robust.Shared.Utility; @@ -73,7 +74,7 @@ namespace Content.Server.PowerCell.Components CurrentCharge = 0; EntitySystem.Get().SpawnExplosion(OwnerUid, 0, heavy, light, light*2); - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); } private void UpdateVisuals() diff --git a/Content.Server/Projectiles/Components/HitscanComponent.cs b/Content.Server/Projectiles/Components/HitscanComponent.cs index 4015978314..5fa09caccf 100644 --- a/Content.Server/Projectiles/Components/HitscanComponent.cs +++ b/Content.Server/Projectiles/Components/HitscanComponent.cs @@ -98,7 +98,7 @@ namespace Content.Server.Projectiles.Components { if (!((!IoCManager.Resolve().EntityExists(Owner.Uid) ? EntityLifeStage.Deleted : IoCManager.Resolve().GetComponent(Owner.Uid).EntityLifeStage) >= EntityLifeStage.Deleted)) { - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); } }); } diff --git a/Content.Server/Projectiles/ProjectileSystem.cs b/Content.Server/Projectiles/ProjectileSystem.cs index e34e970c52..f5f06d411e 100644 --- a/Content.Server/Projectiles/ProjectileSystem.cs +++ b/Content.Server/Projectiles/ProjectileSystem.cs @@ -83,7 +83,7 @@ namespace Content.Server.Projectiles if (component.TimeLeft <= 0) { - component.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(component.Owner.Uid); } } } diff --git a/Content.Server/RCD/Systems/RCDSystem.cs b/Content.Server/RCD/Systems/RCDSystem.cs index 02a8ca6c18..8ac21a4508 100644 --- a/Content.Server/RCD/Systems/RCDSystem.cs +++ b/Content.Server/RCD/Systems/RCDSystem.cs @@ -118,7 +118,11 @@ namespace Content.Server.RCD.Systems } else //Delete what the user targeted { - args.Target?.Delete(); + IEntity? tempQualifier = args.Target; + if (tempQualifier != null) + { + IoCManager.Resolve().DeleteEntity(tempQualifier.Uid); + } } break; //Walls are a special behaviour, and require us to build a new object with a transform rather than setting a grid tile, diff --git a/Content.Server/Rotatable/RotatableSystem.cs b/Content.Server/Rotatable/RotatableSystem.cs index c4f6b5a7d3..e262ac45ac 100644 --- a/Content.Server/Rotatable/RotatableSystem.cs +++ b/Content.Server/Rotatable/RotatableSystem.cs @@ -88,7 +88,7 @@ namespace Content.Server.Rotatable var newTransform = entity.Transform; newTransform.LocalRotation = oldTransform.LocalRotation; newTransform.Anchored = false; - component.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(component.Owner.Uid); } } } diff --git a/Content.Server/Singularity/Components/ContainmentFieldConnection.cs b/Content.Server/Singularity/Components/ContainmentFieldConnection.cs index ece1ad6c8f..f61ffa4d98 100644 --- a/Content.Server/Singularity/Components/ContainmentFieldConnection.cs +++ b/Content.Server/Singularity/Components/ContainmentFieldConnection.cs @@ -57,7 +57,7 @@ namespace Content.Server.Singularity.Components if (!newEnt.TryGetComponent(out var containmentFieldComponent)) { Logger.Error("While creating Fields in ContainmentFieldConnection, a ContainmentField without a ContainmentFieldComponent was created. Deleting newly spawned ContainmentField..."); - newEnt.Delete(); + IoCManager.Resolve().DeleteEntity(newEnt.Uid); continue; } @@ -88,7 +88,7 @@ namespace Content.Server.Singularity.Components _powerDecreaseCancellationTokenSource.Cancel(); foreach (var field in _fields) { - field.Delete(); + IoCManager.Resolve().DeleteEntity(field.Uid); } _fields.Clear(); diff --git a/Content.Server/Singularity/Components/ServerSingularityComponent.cs b/Content.Server/Singularity/Components/ServerSingularityComponent.cs index 21f8e4def8..4ec8069968 100644 --- a/Content.Server/Singularity/Components/ServerSingularityComponent.cs +++ b/Content.Server/Singularity/Components/ServerSingularityComponent.cs @@ -4,6 +4,7 @@ using Content.Shared.Sound; using Robust.Shared.Audio; using Robust.Shared.Containers; using Robust.Shared.GameObjects; +using Robust.Shared.IoC; using Robust.Shared.Physics.Collision; using Robust.Shared.Physics.Dynamics; using Robust.Shared.Player; @@ -31,7 +32,7 @@ namespace Content.Server.Singularity.Components _energy = value; if (_energy <= 0) { - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); return; } diff --git a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs index 678c43b953..b4abbf713a 100644 --- a/Content.Server/Singularity/EntitySystems/EmitterSystem.cs +++ b/Content.Server/Singularity/EntitySystems/EmitterSystem.cs @@ -189,7 +189,7 @@ namespace Content.Server.Singularity.EntitySystems projectile.Transform.WorldRotation = component.Owner.Transform.WorldRotation; // TODO: Move to projectile's code. - Timer.Spawn(3000, () => projectile.Delete()); + Timer.Spawn(3000, () => IoCManager.Resolve().DeleteEntity(projectile.Uid)); SoundSystem.Play(Filter.Pvs(component.Owner), component.FireSound.GetSound(), component.Owner, AudioHelpers.WithVariation(EmitterComponent.Variation).WithVolume(EmitterComponent.Volume).WithMaxDistance(EmitterComponent.Distance)); diff --git a/Content.Server/Spawners/Components/RandomSpawnerComponent.cs b/Content.Server/Spawners/Components/RandomSpawnerComponent.cs index 248beb16d4..5d38b95fa8 100644 --- a/Content.Server/Spawners/Components/RandomSpawnerComponent.cs +++ b/Content.Server/Spawners/Components/RandomSpawnerComponent.cs @@ -63,7 +63,7 @@ namespace Content.Server.Spawners.Components public override void MapInit() { Spawn(); - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); } } } diff --git a/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs b/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs index e694aa237a..be16994d48 100644 --- a/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs +++ b/Content.Server/Storage/EntitySystems/SpawnItemsOnUseSystem.cs @@ -55,7 +55,7 @@ namespace Content.Server.Storage.EntitySystems if (component.Uses == 0) { args.Handled = true; - owner.Delete(); + IoCManager.Resolve().DeleteEntity(owner.Uid); } if (entityToPlaceInHands != null diff --git a/Content.Server/TraitorDeathMatch/Components/TraitorDeathMatchRedemptionComponent.cs b/Content.Server/TraitorDeathMatch/Components/TraitorDeathMatchRedemptionComponent.cs index fca255a89d..d830c3881b 100644 --- a/Content.Server/TraitorDeathMatch/Components/TraitorDeathMatchRedemptionComponent.cs +++ b/Content.Server/TraitorDeathMatch/Components/TraitorDeathMatchRedemptionComponent.cs @@ -111,7 +111,7 @@ namespace Content.Server.TraitorDeathMatch.Components accounts.SetBalance(victimAccount, 0); accounts.AddToBalance(userAccount, transferAmount); - victimUplink.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(victimUplink.Owner.Uid); Owner.PopupMessage(eventArgs.User, Loc.GetString("traitor-death-match-redemption-component-interact-using-success-message", ("tcAmount", transferAmount))); return true; diff --git a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs index 6a09884b9a..c69417f8f7 100644 --- a/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs +++ b/Content.Server/Weapon/Ranged/Barrels/Components/ServerRangedBarrelComponent.cs @@ -238,7 +238,7 @@ namespace Content.Server.Weapon.Ranged.Barrels.Components if (ammoComponent.Caseless) { - ammo.Delete(); + IoCManager.Resolve().DeleteEntity(ammo.Uid); } } else diff --git a/Content.Server/Weapon/Ranged/ServerRangedWeaponComponent.cs b/Content.Server/Weapon/Ranged/ServerRangedWeaponComponent.cs index fca615909f..b4751d2cf2 100644 --- a/Content.Server/Weapon/Ranged/ServerRangedWeaponComponent.cs +++ b/Content.Server/Weapon/Ranged/ServerRangedWeaponComponent.cs @@ -187,7 +187,7 @@ namespace Content.Server.Weapon.Ranged user.PopupMessage(Loc.GetString("server-ranged-weapon-component-try-fire-clumsy")); - Owner.Delete(); + IoCManager.Resolve().DeleteEntity(Owner.Uid); return; } diff --git a/Content.Shared/Body/Components/SharedBodyPartComponent.cs b/Content.Shared/Body/Components/SharedBodyPartComponent.cs index ef6c2ae37f..c24f308f27 100644 --- a/Content.Shared/Body/Components/SharedBodyPartComponent.cs +++ b/Content.Shared/Body/Components/SharedBodyPartComponent.cs @@ -293,7 +293,7 @@ namespace Content.Shared.Body.Components return false; } - mechanism.Owner.Delete(); + IoCManager.Resolve().DeleteEntity(mechanism.Owner.Uid); return true; }