Files
tbd-station-14/Content.Shared/Speech/SpeechSystem.cs
2022-05-13 17:59:03 +10:00

19 lines
467 B
C#

namespace Content.Shared.Speech
{
public sealed class SpeechSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SpeakAttemptEvent>(OnSpeakAttempt);
}
private void OnSpeakAttempt(SpeakAttemptEvent args)
{
if (!TryComp(args.Uid, out SharedSpeechComponent? speech) || !speech.Enabled)
args.Cancel();
}
}
}