Misc. AI fixes for CM test (#1165)

* Dumped ranged behaviors
* Fixed some 1-liners (open storage, distancecon todo)

Co-authored-by: Metal Gear Sloth <metalgearsloth@gmail.com>
This commit is contained in:
metalgearsloth
2020-06-22 05:48:22 +10:00
committed by GitHub
parent 95995b6232
commit 99f46d1ca5
9 changed files with 20 additions and 14 deletions

View File

@@ -3,6 +3,7 @@ using Content.Server.AI.WorldState.States.Inventory;
using Content.Server.GameObjects.Components;
using Content.Server.GameObjects.EntitySystems;
using Content.Server.Utility;
using Content.Shared.GameObjects.EntitySystems;
using Robust.Shared.Containers;
using Robust.Shared.Interfaces.GameObjects;
@@ -24,15 +25,15 @@ namespace Content.Server.AI.Operators.Inventory
public override Outcome Execute(float frameTime)
{
if (!InteractionChecks.InRangeUnobstructed(_owner, _target.Transform.MapPosition))
{
return Outcome.Failed;
}
if (!ContainerHelpers.TryGetContainer(_target, out var container))
{
return Outcome.Success;
}
if (!InteractionChecks.InRangeUnobstructed(_owner, container.Owner.Transform.MapPosition, ignoredEnt: container.Owner))
{
return Outcome.Failed;
}
if (!container.Owner.TryGetComponent(out EntityStorageComponent storageComponent) ||
storageComponent.IsWeldedShut)