Files
OldThink/Content.Shared/Speech/SpeechSystem.cs

19 lines
467 B
C#
Raw Normal View History

2022-05-13 00:59:03 -07:00
namespace Content.Shared.Speech
{
public sealed class SpeechSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
2022-01-08 00:57:20 +13:00
SubscribeLocalEvent<SpeakAttemptEvent>(OnSpeakAttempt);
}
2022-01-08 00:57:20 +13:00
private void OnSpeakAttempt(SpeakAttemptEvent args)
{
2022-01-08 00:57:20 +13:00
if (!TryComp(args.Uid, out SharedSpeechComponent? speech) || !speech.Enabled)
args.Cancel();
}
}
}