Files
OldThink/Content.Shared/Emoting/EmoteSystem.cs

19 lines
466 B
C#
Raw Normal View History

2022-05-13 00:59:03 -07:00
namespace Content.Shared.Emoting
{
public sealed class EmoteSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
2022-01-08 00:57:20 +13:00
SubscribeLocalEvent<EmoteAttemptEvent>(OnEmoteAttempt);
}
2022-01-08 00:57:20 +13:00
private void OnEmoteAttempt(EmoteAttemptEvent args)
{
2022-01-08 00:57:20 +13:00
if (!TryComp(args.Uid, out SharedEmotingComponent? emote) || !emote.Enabled)
args.Cancel();
}
}
}