Fix/ECS SharedEmotingComponent.

IActionBlocker -> events
Fix networking.
This commit is contained in:
Pieter-Jan Briers
2021-09-15 16:17:09 +02:00
parent 7cee263955
commit 9733d35de7
2 changed files with 37 additions and 10 deletions

View File

@@ -8,15 +8,13 @@ namespace Content.Shared.Emoting
{
base.Initialize();
SubscribeLocalEvent<EmoteAttemptEvent>(OnEmoteAttempt);
SubscribeLocalEvent<SharedEmotingComponent, EmoteAttemptEvent>(OnEmoteAttempt);
}
private void OnEmoteAttempt(EmoteAttemptEvent ev)
private void OnEmoteAttempt(EntityUid entity, SharedEmotingComponent component, EmoteAttemptEvent ev)
{
if (!ev.Entity.HasComponent<SharedEmotingComponent>())
{
if (!component.Enabled)
ev.Cancel();
}
}
}
}