diff --git a/Content.Server/GameObjects/Components/Chemistry/RehydratableComponent.cs b/Content.Server/GameObjects/Components/Chemistry/RehydratableComponent.cs index e5cc33c2ff..59d95f2054 100644 --- a/Content.Server/GameObjects/Components/Chemistry/RehydratableComponent.cs +++ b/Content.Server/GameObjects/Components/Chemistry/RehydratableComponent.cs @@ -3,6 +3,7 @@ using Content.Server.Utility; using Content.Shared.Chemistry; using Content.Shared.GameObjects.EntitySystems; using Content.Shared.Interfaces.GameObjects.Components; +using Content.Shared.Utility; using Robust.Shared.GameObjects; using Robust.Shared.Localization; using Robust.Shared.Serialization; @@ -67,7 +68,8 @@ namespace Content.Server.GameObjects.Components.Chemistry Owner.PopupMessageEveryone(Loc.GetString("{0:TheName} expands!", Owner)); if (!string.IsNullOrEmpty(_targetPrototype)) { - Owner.EntityManager.SpawnEntity(_targetPrototype, Owner.Transform.Coordinates); + var ent = Owner.EntityManager.SpawnEntity(_targetPrototype, Owner.Transform.Coordinates); + ent.Transform.AttachToGridOrMap(); } Owner.Delete(); } diff --git a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs index c7c35f4295..584ab4cd19 100644 --- a/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs +++ b/Content.Shared/GameObjects/Components/Chemistry/SharedSolutionContainerComponent.cs @@ -171,8 +171,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry private void SolutionChanged() { - EntitySystem.Get() - .HandleSolutionChange(Owner); + EntitySystem.Get().HandleSolutionChange(Owner); } private void ProcessReactions() @@ -212,7 +211,7 @@ namespace Content.Shared.GameObjects.Components.Chemistry private void UpdateAppearance() { - if (!Owner.TryGetComponent(out var appearance)) + if (Owner.Deleted || !Owner.TryGetComponent(out var appearance)) return; appearance.SetData(SolutionContainerVisuals.VisualState, GetVisualState()); diff --git a/Content.Shared/GameObjects/EntitySystems/ChemistrySystem.cs b/Content.Shared/GameObjects/EntitySystems/ChemistrySystem.cs index 9c414cd6f8..e6e531eb1a 100644 --- a/Content.Shared/GameObjects/EntitySystems/ChemistrySystem.cs +++ b/Content.Shared/GameObjects/EntitySystems/ChemistrySystem.cs @@ -36,6 +36,9 @@ namespace Content.Shared.GameObjects.EntitySystems foreach (var solutionChangeArg in solutionChangeArgs) { solutionChangeArg.SolutionChanged(eventArgs); + + if (owner.Deleted) + return; } } }