Rehydratable component attaches spawned entities to grid or map.

Also fix crash when injecting rehydratable with a solution.
- Fixes #2969
This commit is contained in:
Vera Aguilera Puerto
2021-01-10 15:40:04 +01:00
parent 7d78f6779f
commit 39c220c433
3 changed files with 8 additions and 4 deletions

View File

@@ -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();
}