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