ActionBlocker CanMove uses EntityUid exclusively

This commit is contained in:
Vera Aguilera Puerto
2021-11-09 13:15:55 +01:00
parent 1f9e1c033f
commit 5f9cfaac43
10 changed files with 19 additions and 24 deletions

View File

@@ -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;

View File

@@ -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;
}