deleted check (#8893)
This commit is contained in:
@@ -63,7 +63,7 @@ namespace Content.Server.Polymorph.Systems
|
|||||||
/// </summary>
|
/// </summary>
|
||||||
/// <param name="target">The entity that will be transformed</param>
|
/// <param name="target">The entity that will be transformed</param>
|
||||||
/// <param name="id">The id of the polymorph prototype</param>
|
/// <param name="id">The id of the polymorph prototype</param>
|
||||||
public EntityUid? PolymorphEntity(EntityUid target, String id)
|
public EntityUid? PolymorphEntity(EntityUid target, string id)
|
||||||
{
|
{
|
||||||
if (!_proto.TryIndex<PolymorphPrototype>(id, out var proto))
|
if (!_proto.TryIndex<PolymorphPrototype>(id, out var proto))
|
||||||
{
|
{
|
||||||
@@ -99,9 +99,8 @@ namespace Content.Server.Polymorph.Systems
|
|||||||
comp.Prototype = proto;
|
comp.Prototype = proto;
|
||||||
RaiseLocalEvent(child, new PolymorphComponentSetupEvent());
|
RaiseLocalEvent(child, new PolymorphComponentSetupEvent());
|
||||||
|
|
||||||
var targetXform = Transform(target);
|
|
||||||
var childXform = Transform(child);
|
var childXform = Transform(child);
|
||||||
childXform.LocalRotation = targetXform.LocalRotation;
|
childXform.LocalRotation = targetTransformComp.LocalRotation;
|
||||||
|
|
||||||
if (_container.TryGetContainingContainer(target, out var cont))
|
if (_container.TryGetContainingContainer(target, out var cont))
|
||||||
cont.Insert(child);
|
cont.Insert(child);
|
||||||
|
|||||||
@@ -49,6 +49,9 @@ namespace Content.Server.Polymorph.Systems
|
|||||||
if (!TryComp<PolymorphedEntityComponent>(uid, out var component))
|
if (!TryComp<PolymorphedEntityComponent>(uid, out var component))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
if (Deleted(component.Parent))
|
||||||
|
return;
|
||||||
|
|
||||||
var proto = component.Prototype;
|
var proto = component.Prototype;
|
||||||
|
|
||||||
var uidXform = Transform(uid);
|
var uidXform = Transform(uid);
|
||||||
|
|||||||
Reference in New Issue
Block a user