Inline QueueDelete

This commit is contained in:
Vera Aguilera Puerto
2021-12-03 11:43:22 +01:00
parent e3227546b3
commit c2e6da1e54
18 changed files with 26 additions and 22 deletions

View File

@@ -226,7 +226,7 @@ namespace Content.Client.Construction
{
if (_ghosts.TryGetValue(ghostId, out var ghost))
{
ghost.Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(ghost.Owner.Uid);
_ghosts.Remove(ghostId);
}
}
@@ -238,7 +238,7 @@ namespace Content.Client.Construction
{
foreach (var (_, ghost) in _ghosts)
{
ghost.Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(ghost.Owner.Uid);
}
_ghosts.Clear();

View File

@@ -58,7 +58,7 @@ namespace Content.Server.AME.Components
SoundSystem.Play(Filter.Pvs(Owner), _unwrapSound.GetSound(), Owner);
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
return true;
}

View File

@@ -271,7 +271,7 @@ namespace Content.Server.Atmos.Components
EntitySystem.Get<ExplosionSystem>().SpawnExplosion(OwnerUid, (int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1);
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
return;
}
@@ -285,7 +285,7 @@ namespace Content.Server.Atmos.Components
SoundSystem.Play(Filter.Pvs(Owner), _ruptureSound.GetSound(), Owner.Transform.Coordinates, AudioHelpers.WithVariation(0.125f));
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
return;
}

View File

@@ -103,7 +103,7 @@ namespace Content.Server.Body.Components
}
}
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
}
}
}

View File

@@ -27,7 +27,7 @@ namespace Content.Server.Botany.Components
plank.RandomOffset(0.25f);
}
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
return true;
}

View File

@@ -661,7 +661,7 @@ namespace Content.Server.Botany.Components
if (seeds.Seed == null)
{
user.PopupMessageCursor(Loc.GetString("plant-holder-component-empty-seed-packet-message"));
usingItem.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(usingItem.Uid);
return false;
}
@@ -675,7 +675,7 @@ namespace Content.Server.Botany.Components
Health = Seed.Endurance;
_lastCycle = _gameTiming.CurTime;
usingItem.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(usingItem.Uid);
CheckLevelSanity();
UpdateSprite();
@@ -823,7 +823,7 @@ namespace Content.Server.Botany.Components
ForceUpdateByExternalCause();
}
usingItem.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(usingItem.Uid);
return true;
}

View File

@@ -31,7 +31,7 @@ namespace Content.Server.Botany.Components
{
eventArgs.User.PopupMessageCursor(Loc.GetString("seed-extractor-component-interact-message",("name", eventArgs.Using.Name)));
eventArgs.Using.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(eventArgs.Using.Uid);
var random = _random.Next(_minSeeds, _maxSeeds);

View File

@@ -82,7 +82,7 @@ namespace Content.Server.Chemistry.Components
IoCManager.Resolve<IEntityManager>().SpawnEntity(_foamedMetalPrototype, Owner.Transform.Coordinates);
}
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
});
}
}

View File

@@ -45,7 +45,7 @@ namespace Content.Server.Chemistry.EntitySystems
ent.Transform.AttachToGridOrMap();
}
owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(owner.Uid);
}
}
}

View File

@@ -123,7 +123,7 @@ namespace Content.Server.Chemistry.EntitySystems
if (contents.CurrentVolume == 0 || vapor.Timer > vapor.AliveTime)
{
// Delete this
entity.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(entity.Uid);
}
}
}

View File

@@ -122,7 +122,7 @@ namespace Content.Server.Chemistry.ReactionEffects
if (areaEffectComponent == null)
{
Logger.Error("Couldn't get AreaEffectComponent from " + _prototypeId);
ent.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(ent.Uid);
return;
}

View File

@@ -5,6 +5,8 @@ using Content.Shared.Chemistry;
using Content.Shared.Chemistry.Reaction;
using Content.Shared.Chemistry.Reagent;
using Content.Shared.FixedPoint;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Map;
using Robust.Shared.Serialization.Manager.Attributes;
@@ -31,7 +33,7 @@ namespace Content.Server.Chemistry.TileReactions
break;
amount = next;
entity.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(entity.Uid);
}
}

View File

@@ -3,6 +3,7 @@ using System.Threading.Tasks;
using Content.Shared.Construction;
using Robust.Shared.Containers;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
using Robust.Shared.Serialization.Manager.Attributes;
namespace Content.Server.Construction.Completions
@@ -22,7 +23,7 @@ namespace Content.Server.Construction.Completions
foreach (var contained in container.ContainedEntities.ToArray())
{
if(container.Remove(contained))
contained.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(contained.Uid);
}
}
}

View File

@@ -124,7 +124,7 @@ namespace Content.Server.Fluids.EntitySystems
if (!puddle.Owner.Transform.Anchored)
return;
puddle.Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(puddle.Owner.Uid);
}
/// <summary>

View File

@@ -5,6 +5,7 @@ using Content.Shared.Hands.Components;
using Content.Shared.Interaction;
using JetBrains.Annotations;
using Robust.Shared.GameObjects;
using Robust.Shared.IoC;
namespace Content.Server.Hands.Systems
{
@@ -73,7 +74,7 @@ namespace Content.Server.Hands.Systems
var targEv = new VirtualItemDeletedEvent(comp.BlockingEntity, user);
RaiseLocalEvent(comp.BlockingEntity, targEv, false);
comp.Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(comp.Owner.Uid);
}
/// <summary>

View File

@@ -112,7 +112,7 @@ namespace Content.Server.Radiation
return;
if (_duration <= 0f)
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
_duration -= frameTime;
}

View File

@@ -38,7 +38,7 @@ namespace Content.Server.Recycling.Components
}
Owner.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(Owner.Uid);
}
}
}

View File

@@ -125,7 +125,7 @@ namespace Content.Server.Singularity.EntitySystems
otherSingulo.BeingDeletedByAnotherSingularity = true;
}
entity.QueueDelete();
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity(entity.Uid);
if (entity.TryGetComponent<SinguloFoodComponent>(out var singuloFood))
component.Energy += singuloFood.Energy;