Deprecate IActionBlocker in favour of cancellable events (#4193)
* Deprecate IActionBlocker in favour of cancellable events * Bring back old speech/emoting component restrictions * Rename action blocker listener methods * Use Entity System public methods instead of extension methods Co-authored-by: Vera Aguilera Puerto <gradientvera@outlook.com>
This commit is contained in:
@@ -7,6 +7,7 @@ using Content.Server.Wires.Components;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Arcade;
|
||||
using Content.Shared.Interaction;
|
||||
using Content.Shared.Interaction.Events;
|
||||
using Content.Shared.Wires;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.Audio;
|
||||
@@ -58,15 +59,11 @@ namespace Content.Server.Arcade.Components
|
||||
|
||||
void IActivate.Activate(ActivateEventArgs eventArgs)
|
||||
{
|
||||
if(!eventArgs.User.TryGetComponent(out ActorComponent? actor))
|
||||
{
|
||||
if(!Powered || !eventArgs.User.TryGetComponent(out ActorComponent? actor))
|
||||
return;
|
||||
}
|
||||
if (!Powered)
|
||||
{
|
||||
|
||||
if(!EntitySystem.Get<ActionBlockerSystem>().CanInteract(eventArgs.User))
|
||||
return;
|
||||
}
|
||||
if(!ActionBlockerSystem.CanInteract(actor.PlayerSession.AttachedEntity)) return;
|
||||
|
||||
_game ??= new SpaceVillainGame(this);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user