Makes more things queue delete to prevent physics collision callback issues.

This commit is contained in:
Vera Aguilera Puerto
2021-05-26 18:43:12 +02:00
parent 2232dbd71d
commit f64433a14d
14 changed files with 18 additions and 18 deletions

View File

@@ -184,7 +184,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
if (_ghosts.TryGetValue(ghostId, out var ghost)) if (_ghosts.TryGetValue(ghostId, out var ghost))
{ {
ghost.Owner.Delete(); ghost.Owner.QueueDelete();
_ghosts.Remove(ghostId); _ghosts.Remove(ghostId);
} }
} }
@@ -196,7 +196,7 @@ namespace Content.Client.GameObjects.EntitySystems
{ {
foreach (var (_, ghost) in _ghosts) foreach (var (_, ghost) in _ghosts)
{ {
ghost.Owner.Delete(); ghost.Owner.QueueDelete();
} }
_ghosts.Clear(); _ghosts.Clear();

View File

@@ -129,7 +129,7 @@ namespace Content.Server.Chemistry.ReactionEffects
if (areaEffectComponent == null) if (areaEffectComponent == null)
{ {
Logger.Error("Couldn't get AreaEffectComponent from " + _prototypeId); Logger.Error("Couldn't get AreaEffectComponent from " + _prototypeId);
ent.Delete(); ent.QueueDelete();
return; return;
} }

View File

@@ -25,7 +25,7 @@ namespace Content.Server.Chemistry.TileReactions
break; break;
amount = next; amount = next;
entity.Delete(); entity.QueueDelete();
} }
} }

View File

@@ -22,7 +22,7 @@ namespace Content.Server.Construction.Completions
foreach (var contained in container.ContainedEntities.ToArray()) foreach (var contained in container.ContainedEntities.ToArray())
{ {
if(container.Remove(contained)) if(container.Remove(contained))
contained.Delete(); contained.QueueDelete();
} }
} }
} }

View File

@@ -269,7 +269,7 @@ namespace Content.Server.GameObjects.Components.Atmos
Owner.SpawnExplosion((int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1); Owner.SpawnExplosion((int) (range * 0.25f), (int) (range * 0.5f), (int) (range * 1.5f), 1);
Owner.Delete(); Owner.QueueDelete();
return; return;
} }
@@ -283,7 +283,7 @@ namespace Content.Server.GameObjects.Components.Atmos
SoundSystem.Play(Filter.Pvs(Owner), "Audio/Effects/spray.ogg", Owner.Transform.Coordinates, SoundSystem.Play(Filter.Pvs(Owner), "Audio/Effects/spray.ogg", Owner.Transform.Coordinates,
AudioHelpers.WithVariation(0.125f)); AudioHelpers.WithVariation(0.125f));
Owner.Delete(); Owner.QueueDelete();
return; return;
} }

View File

@@ -25,7 +25,7 @@ namespace Content.Server.GameObjects.Components.Botany
plank.RandomOffset(0.25f); plank.RandomOffset(0.25f);
} }
Owner.Delete(); Owner.QueueDelete();
return true; return true;
} }

View File

@@ -655,7 +655,7 @@ namespace Content.Server.GameObjects.Components.Botany
if (seeds.Seed == null) if (seeds.Seed == null)
{ {
user.PopupMessageCursor(Loc.GetString("The packet seems to be empty. You throw it away.")); user.PopupMessageCursor(Loc.GetString("The packet seems to be empty. You throw it away."));
usingItem.Delete(); usingItem.QueueDelete();
return false; return false;
} }
@@ -667,7 +667,7 @@ namespace Content.Server.GameObjects.Components.Botany
Health = Seed.Endurance; Health = Seed.Endurance;
_lastCycle = _gameTiming.CurTime; _lastCycle = _gameTiming.CurTime;
usingItem.Delete(); usingItem.QueueDelete();
CheckLevelSanity(); CheckLevelSanity();
UpdateSprite(); UpdateSprite();
@@ -799,7 +799,7 @@ namespace Content.Server.GameObjects.Components.Botany
ForceUpdateByExternalCause(); ForceUpdateByExternalCause();
} }
usingItem.Delete(); usingItem.QueueDelete();
return true; return true;
} }

View File

@@ -32,7 +32,7 @@ namespace Content.Server.GameObjects.Components.Botany
{ {
eventArgs.User.PopupMessageCursor(Loc.GetString("You extract some seeds from the {0}.", eventArgs.Using.Name)); eventArgs.User.PopupMessageCursor(Loc.GetString("You extract some seeds from the {0}.", eventArgs.Using.Name));
eventArgs.Using.Delete(); eventArgs.Using.QueueDelete();
var random = _random.Next(_minSeeds, _maxSeeds); var random = _random.Next(_minSeeds, _maxSeeds);

View File

@@ -75,7 +75,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
{ {
Owner.EntityManager.SpawnEntity(_foamedMetalPrototype, Owner.Transform.Coordinates); Owner.EntityManager.SpawnEntity(_foamedMetalPrototype, Owner.Transform.Coordinates);
} }
Owner.Delete(); Owner.QueueDelete();
}); });
} }
} }

View File

@@ -108,7 +108,7 @@ namespace Content.Server.GameObjects.Components.Chemistry
trueTarget.PopupMessage(user, Loc.GetString("You swallow the pill.")); trueTarget.PopupMessage(user, Loc.GetString("You swallow the pill."));
Owner.Delete(); Owner.QueueDelete();
return true; return true;
} }
} }

View File

@@ -44,7 +44,7 @@ namespace Content.Server.GameObjects.Components.Nutrition
solution.Solution.SpillAt(Owner, "PuddleSmear", false); solution.Solution.SpillAt(Owner, "PuddleSmear", false);
} }
Owner.Delete(); Owner.QueueDelete();
} }
} }
} }

View File

@@ -38,7 +38,7 @@ namespace Content.Server.GameObjects.Components.Recycling
} }
Owner.Delete(); Owner.QueueDelete();
} }
} }
} }

View File

@@ -40,7 +40,7 @@ namespace Content.Server.GameObjects.EntitySystems
grid.TileIndicesFor(puddleTransform.Coordinates) == eventArgs.NewTile.GridIndices && grid.TileIndicesFor(puddleTransform.Coordinates) == eventArgs.NewTile.GridIndices &&
eventArgs.NewTile.Tile.IsEmpty) eventArgs.NewTile.Tile.IsEmpty)
{ {
puddle.Owner.Delete(); puddle.Owner.QueueDelete();
break; // Currently it's one puddle per tile, if that changes remove this break; // Currently it's one puddle per tile, if that changes remove this
} }
} }

View File

@@ -68,7 +68,7 @@ namespace Content.Shared.GameObjects.EntitySystems
destroyAct.OnDestroy(eventArgs); destroyAct.OnDestroy(eventArgs);
} }
owner.Delete(); owner.QueueDelete();
} }
public void HandleExplosion(EntityCoordinates source, IEntity target, ExplosionSeverity severity) public void HandleExplosion(EntityCoordinates source, IEntity target, ExplosionSeverity severity)