From 9adcb481738ce2e8b6052768582c057641f03a92 Mon Sep 17 00:00:00 2001 From: EmoGarbage404 <98561806+EmoGarbage404@users.noreply.github.com> Date: Fri, 17 Jun 2022 03:22:09 -0400 Subject: [PATCH] deleted check (#8893) --- Content.Server/Polymorph/Systems/PolymorphableSystem.cs | 5 ++--- Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs | 3 +++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/Content.Server/Polymorph/Systems/PolymorphableSystem.cs b/Content.Server/Polymorph/Systems/PolymorphableSystem.cs index a2d2771dc7..90641a4baf 100644 --- a/Content.Server/Polymorph/Systems/PolymorphableSystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphableSystem.cs @@ -63,7 +63,7 @@ namespace Content.Server.Polymorph.Systems /// /// The entity that will be transformed /// The id of the polymorph prototype - public EntityUid? PolymorphEntity(EntityUid target, String id) + public EntityUid? PolymorphEntity(EntityUid target, string id) { if (!_proto.TryIndex(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); diff --git a/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs b/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs index b14354acef..ced781d2de 100644 --- a/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs +++ b/Content.Server/Polymorph/Systems/PolymorphedEntitySystem.cs @@ -49,6 +49,9 @@ namespace Content.Server.Polymorph.Systems if (!TryComp(uid, out var component)) return; + if (Deleted(component.Parent)) + return; + var proto = component.Prototype; var uidXform = Transform(uid);