Misc content xform changes (#12166)

This commit is contained in:
Leon Friedrich
2022-10-24 20:19:51 +13:00
committed by GitHub
parent 79bd07009a
commit 0b8622e9e7
3 changed files with 4 additions and 32 deletions

View File

@@ -1,23 +0,0 @@
namespace Content.Shared.Transform
{
public static class TransformExtensions
{
public static void AttachToGrandparent(this TransformComponent transform)
{
var grandParent = transform.Parent?.Parent;
if (grandParent == null)
{
transform.AttachToGridOrMap();
return;
}
transform.AttachParent(grandParent);
}
public static void AttachToGrandparent(this EntityUid entity)
{
AttachToGrandparent(IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(entity));
}
}
}