Fix some action-blocker bugs (#6050)

This commit is contained in:
Leon Friedrich
2022-01-08 00:57:20 +13:00
committed by GitHub
parent c29489ff4d
commit 2f3b6fb28e
3 changed files with 23 additions and 10 deletions

View File

@@ -8,13 +8,13 @@ namespace Content.Shared.Emoting
{
base.Initialize();
SubscribeLocalEvent<SharedEmotingComponent, EmoteAttemptEvent>(OnEmoteAttempt);
SubscribeLocalEvent<EmoteAttemptEvent>(OnEmoteAttempt);
}
private void OnEmoteAttempt(EntityUid entity, SharedEmotingComponent component, EmoteAttemptEvent ev)
private void OnEmoteAttempt(EmoteAttemptEvent args)
{
if (!component.Enabled)
ev.Cancel();
if (!TryComp(args.Uid, out SharedEmotingComponent? emote) || !emote.Enabled)
args.Cancel();
}
}
}