CatStation/Content.Shared/EntityConditions/Conditions/Generic/InSpaceConditionSystem.cs
Jessica M e0dd1c5404
Refactor ambient music rules to use EntityConditions (#44696)
* i guess one big mega commit sorry

* cleanup and reviews

* mfw you cherrypick from an outdated commit on the other branch and its all fucked up and the world sees it..

* reviews
2026-07-17 15:25:03 -04:00

21 lines
697 B
C#

using Robust.Shared.Prototypes;
namespace Content.Shared.EntityConditions.Conditions.Generic;
/// <summary>
/// Returns true if the entity is in space.
/// </summary>
public sealed class InSpaceConditionSystem : EntityConditionSystem<TransformComponent, InSpaceCondition>
{
protected override void Condition(Entity<TransformComponent> entity, ref EntityConditionEvent<InSpaceCondition> args)
{
args.Result = entity.Comp.GridUid == null;
}
}
/// <inheritdoc cref="EntityCondition"/>
public sealed partial class InSpaceCondition : EntityConditionBase<InSpaceCondition>
{
public override string EntityConditionGuidebookText(IPrototypeManager prototype) => String.Empty;
}