ActionBlocker CanUse uses EntityUid exclusively
This commit is contained in:
@@ -174,7 +174,7 @@ namespace Content.Server.AME.Components
|
||||
var actionBlocker = EntitySystem.Get<ActionBlockerSystem>();
|
||||
|
||||
//Check if player can interact in their current state
|
||||
if (!actionBlocker.CanInteract(playerEntity) || !actionBlocker.CanUse(playerEntity))
|
||||
if (!actionBlocker.CanInteract(playerEntity) || !actionBlocker.CanUse(playerEntity.Uid))
|
||||
return false;
|
||||
//Check if device is powered
|
||||
if (needsPower && !Powered)
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace Content.Server.Atmos.Components
|
||||
{
|
||||
var user = GetInternalsComponent()?.Owner;
|
||||
|
||||
if (user == null || !EntitySystem.Get<ActionBlockerSystem>().CanUse(user))
|
||||
if (user == null || !EntitySystem.Get<ActionBlockerSystem>().CanUse(user.Uid))
|
||||
return;
|
||||
|
||||
if (IsConnected)
|
||||
|
||||
@@ -165,7 +165,7 @@ namespace Content.Server.Chemistry.Components
|
||||
var actionBlocker = EntitySystem.Get<ActionBlockerSystem>();
|
||||
|
||||
//Check if player can interact in their current state
|
||||
if (!actionBlocker.CanInteract(playerEntity) || !actionBlocker.CanUse(playerEntity))
|
||||
if (!actionBlocker.CanInteract(playerEntity) || !actionBlocker.CanUse(playerEntity.Uid))
|
||||
return false;
|
||||
//Check if device is powered
|
||||
if (needsPower && !Powered)
|
||||
|
||||
@@ -218,7 +218,7 @@ namespace Content.Server.Chemistry.Components
|
||||
var actionBlocker = EntitySystem.Get<ActionBlockerSystem>();
|
||||
|
||||
//Check if player can interact in their current state
|
||||
if (!actionBlocker.CanInteract(playerEntity) || !actionBlocker.CanUse(playerEntity))
|
||||
if (!actionBlocker.CanInteract(playerEntity) || !actionBlocker.CanUse(playerEntity.Uid))
|
||||
return false;
|
||||
//Check if device is powered
|
||||
if (needsPower && !Powered)
|
||||
|
||||
@@ -147,7 +147,7 @@ namespace Content.Server.Cuffs.Components
|
||||
{
|
||||
if (_cuffing) return true;
|
||||
|
||||
if (eventArgs.Target == null || !EntitySystem.Get<ActionBlockerSystem>().CanUse(eventArgs.User) || !eventArgs.Target.TryGetComponent<CuffableComponent>(out var cuffed))
|
||||
if (eventArgs.Target == null || !EntitySystem.Get<ActionBlockerSystem>().CanUse(eventArgs.User.Uid) || !eventArgs.Target.TryGetComponent<CuffableComponent>(out var cuffed))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -112,7 +112,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
var actionBlocker = EntitySystem.Get<ActionBlockerSystem>();
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
//Check if player can interact in their current state
|
||||
if (!groupController.CanAdminMenu(session) && (!actionBlocker.CanInteract(session.AttachedEntity) || !actionBlocker.CanUse(session.AttachedEntity)))
|
||||
if (!groupController.CanAdminMenu(session) && (!actionBlocker.CanInteract(session.AttachedEntity) || !actionBlocker.CanUse(session.AttachedEntityUid!.Value)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -94,7 +94,7 @@ namespace Content.Server.Disposal.Tube.Components
|
||||
var actionBlocker = EntitySystem.Get<ActionBlockerSystem>();
|
||||
var groupController = IoCManager.Resolve<IConGroupController>();
|
||||
//Check if player can interact in their current state
|
||||
if (!groupController.CanAdminMenu(session) && (!actionBlocker.CanInteract(session.AttachedEntity) || !actionBlocker.CanUse(session.AttachedEntity)))
|
||||
if (!groupController.CanAdminMenu(session) && (!actionBlocker.CanInteract(session.AttachedEntity) || !actionBlocker.CanUse(session.AttachedEntityUid!.Value)))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -97,7 +97,7 @@ namespace Content.Server.Disposal.Unit.Components
|
||||
var actionBlocker = EntitySystem.Get<ActionBlockerSystem>();
|
||||
|
||||
if (!actionBlocker.CanInteract(player) ||
|
||||
!actionBlocker.CanUse(player))
|
||||
!actionBlocker.CanUse(player.Uid))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace Content.Server.HandLabeler
|
||||
{
|
||||
if (session.AttachedEntity is not { } entity
|
||||
|| !Get<ActionBlockerSystem>().CanInteract(entity)
|
||||
|| !Get<ActionBlockerSystem>().CanUse(entity))
|
||||
|| !Get<ActionBlockerSystem>().CanUse(entity.Uid))
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
||||
@@ -105,7 +105,7 @@ namespace Content.Server.Light.Components
|
||||
/// <returns>True if the light's status was toggled, false otherwise.</returns>
|
||||
public bool ToggleStatus(IEntity user)
|
||||
{
|
||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanUse(user)) return false;
|
||||
if (!EntitySystem.Get<ActionBlockerSystem>().CanUse(user.Uid)) return false;
|
||||
return Activated ? TurnOff() : TurnOn(user);
|
||||
}
|
||||
|
||||
|
||||
@@ -44,7 +44,7 @@ namespace Content.Server.Light.EntitySystems
|
||||
return;
|
||||
|
||||
// standard interaction checks
|
||||
if (!_blocker.CanUse(eventArgs.User)) return;
|
||||
if (!_blocker.CanUse(eventArgs.User.Uid)) return;
|
||||
if (!eventArgs.CanReach) return;
|
||||
|
||||
// behaviour will depends on target type
|
||||
|
||||
@@ -73,7 +73,7 @@ namespace Content.Server.Stunnable
|
||||
|
||||
private void OnUseInHand(EntityUid uid, StunbatonComponent comp, UseInHandEvent args)
|
||||
{
|
||||
if (!Get<ActionBlockerSystem>().CanUse(args.User))
|
||||
if (!Get<ActionBlockerSystem>().CanUse(args.User.Uid))
|
||||
return;
|
||||
|
||||
if (comp.Activated)
|
||||
|
||||
Reference in New Issue
Block a user