ActionBlocker CanMove uses EntityUid exclusively
This commit is contained in:
@@ -250,7 +250,7 @@ namespace Content.Server.AI.Steering
|
||||
// Main optimisation to be done below is the redundant calls and adding more variables
|
||||
if (entity.Deleted ||
|
||||
!entity.TryGetComponent(out AiControllerComponent? controller) ||
|
||||
!EntitySystem.Get<ActionBlockerSystem>().CanMove(entity) ||
|
||||
!EntitySystem.Get<ActionBlockerSystem>().CanMove(entity.Uid) ||
|
||||
!entity.Transform.GridID.IsValid())
|
||||
{
|
||||
return SteeringStatus.NoPath;
|
||||
|
||||
@@ -12,7 +12,7 @@ namespace Content.Server.AI.Utility.Considerations.ActionBlocker
|
||||
{
|
||||
var self = context.GetState<SelfState>().GetValue();
|
||||
|
||||
if (self == null || !EntitySystem.Get<ActionBlockerSystem>().CanMove(self))
|
||||
if (self == null || !EntitySystem.Get<ActionBlockerSystem>().CanMove(self.Uid))
|
||||
{
|
||||
return 0.0f;
|
||||
}
|
||||
|
||||
@@ -29,7 +29,7 @@ namespace Content.Server.Climbing
|
||||
|
||||
private void AddClimbVerb(EntityUid uid, ClimbableComponent component, GetAlternativeVerbsEvent args)
|
||||
{
|
||||
if (!args.CanAccess || !args.CanInteract || !_actionBlockerSystem.CanMove(args.User))
|
||||
if (!args.CanAccess || !args.CanInteract || !_actionBlockerSystem.CanMove(args.User.Uid))
|
||||
return;
|
||||
|
||||
// Check that the user climb.
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace Content.Server.Disposal.Unit.EntitySystems
|
||||
if (!args.CanAccess ||
|
||||
!args.CanInteract ||
|
||||
component.ContainedEntities.Contains(args.User) ||
|
||||
!_actionBlockerSystem.CanMove(args.User))
|
||||
!_actionBlockerSystem.CanMove(args.User.Uid))
|
||||
return;
|
||||
|
||||
// Add verb to climb inside of the unit,
|
||||
|
||||
@@ -60,7 +60,7 @@ namespace Content.Server.Medical
|
||||
// Self-insert verb
|
||||
if (!component.IsOccupied &&
|
||||
component.CanInsert(args.User) &&
|
||||
_actionBlockerSystem.CanMove(args.User))
|
||||
_actionBlockerSystem.CanMove(args.User.Uid))
|
||||
{
|
||||
Verb verb = new();
|
||||
verb.Act = () => component.InsertBody(args.User);
|
||||
|
||||
Reference in New Issue
Block a user