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

21 lines
493 B
C#
Raw Normal View History

using Robust.Shared.GameObjects;
namespace Content.Shared.Emoting
{
public 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();
}
}
}