6
2025-12-18 02:55:17 +03:00

19 lines
452 B
C#

namespace Content.Shared.Random.Rules;
/// <summary>
/// Returns true if the attached entity is in space.
/// </summary>
public sealed partial class InSpaceRule : RulesRule
{
public override bool Check(EntityManager entManager, EntityUid uid)
{
if (!entManager.TryGetComponent(uid, out TransformComponent? xform) ||
xform.GridUid != null)
{
return Inverted;
}
return !Inverted;
}
}