Files
tbd-station-14/Content.Shared/Emoting/EmoteSystem.cs
2022-02-16 18:23:23 +11:00

21 lines
500 B
C#

using Robust.Shared.GameObjects;
namespace Content.Shared.Emoting
{
public sealed class EmoteSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<EmoteAttemptEvent>(OnEmoteAttempt);
}
private void OnEmoteAttempt(EmoteAttemptEvent args)
{
if (!TryComp(args.Uid, out SharedEmotingComponent? emote) || !emote.Enabled)
args.Cancel();
}
}
}