Files
tbd-station-14/Content.Shared/Speech/SpeechSystem.cs
2022-01-07 12:57:20 +01:00

21 lines
494 B
C#

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