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

21 lines
501 B
C#
Raw Normal View History

using Robust.Shared.GameObjects;
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();
}
}
}