Fix Implant exception (#12785)
This commit is contained in:
@@ -56,18 +56,19 @@ public abstract class SharedSubdermalImplantSystem : EntitySystem
|
|||||||
|
|
||||||
private void OnRemove(EntityUid uid, SubdermalImplantComponent component, EntGotRemovedFromContainerMessage args)
|
private void OnRemove(EntityUid uid, SubdermalImplantComponent component, EntGotRemovedFromContainerMessage args)
|
||||||
{
|
{
|
||||||
if (component.ImplantedEntity == null)
|
if (component.ImplantedEntity == null || Terminating(component.ImplantedEntity.Value))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var entCoords = Transform(component.ImplantedEntity.Value).Coordinates;
|
|
||||||
|
|
||||||
if (component.ImplantAction != null)
|
if (component.ImplantAction != null)
|
||||||
_actionsSystem.RemoveProvidedActions(component.ImplantedEntity.Value, uid);
|
_actionsSystem.RemoveProvidedActions(component.ImplantedEntity.Value, uid);
|
||||||
|
|
||||||
if (!_container.TryGetContainer(uid, BaseStorageId, out var storageImplant))
|
if (!_container.TryGetContainer(uid, BaseStorageId, out var storageImplant))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
_container.EmptyContainer(storageImplant, moveTo: entCoords);
|
var entCoords = Transform(component.ImplantedEntity.Value).Coordinates;
|
||||||
|
|
||||||
|
// TODO add variant of empty container that dumpes entities into parent containers OR grid OR Map
|
||||||
|
_container.EmptyContainer(storageImplant, true, entCoords, true, EntityManager);
|
||||||
}
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
|||||||
Reference in New Issue
Block a user