Fix 3000 errors
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
using Content.Server.Buckle.Components;
|
||||
using Content.Server.Interaction;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Interaction.Helpers;
|
||||
using Content.Shared.Verbs;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace Content.Server.Buckle.Systems
|
||||
{
|
||||
@@ -39,7 +36,7 @@ namespace Content.Server.Buckle.Systems
|
||||
// Add unstrap verbs for every strapped entity.
|
||||
foreach (var entity in component.BuckledEntities)
|
||||
{
|
||||
var buckledComp = IoCManager.Resolve<IEntityManager>().GetComponent<BuckleComponent>(entity);
|
||||
var buckledComp = EntityManager.GetComponent<BuckleComponent>(entity);
|
||||
|
||||
if (!_interactionSystem.InRangeUnobstructed(args.User, args.Target, range: buckledComp.Range))
|
||||
continue;
|
||||
@@ -50,7 +47,7 @@ namespace Content.Server.Buckle.Systems
|
||||
if (entity == args.User)
|
||||
verb.Text = Loc.GetString("verb-self-target-pronoun");
|
||||
else
|
||||
verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(entity).EntityName;
|
||||
verb.Text = EntityManager.GetComponent<MetaDataComponent>(entity).EntityName;
|
||||
|
||||
// In the event that you have more than once entity with the same name strapped to the same object,
|
||||
// these two verbs will be identical according to Verb.CompareTo, and only one with actually be added to
|
||||
@@ -61,7 +58,7 @@ namespace Content.Server.Buckle.Systems
|
||||
}
|
||||
|
||||
// Add a verb to buckle the user.
|
||||
if (IoCManager.Resolve<IEntityManager>().TryGetComponent<BuckleComponent?>(args.User, out var buckle) &&
|
||||
if (EntityManager.TryGetComponent<BuckleComponent?>(args.User, out var buckle) &&
|
||||
buckle.BuckledTo != component &&
|
||||
args.User != component.Owner &&
|
||||
component.HasSpace(buckle) &&
|
||||
@@ -75,24 +72,24 @@ namespace Content.Server.Buckle.Systems
|
||||
}
|
||||
|
||||
// If the user is currently holding/pulling an entity that can be buckled, add a verb for that.
|
||||
if (args.Using != null &&
|
||||
IoCManager.Resolve<IEntityManager>().TryGetComponent<BuckleComponent?>(args.Using, out var usingBuckle) &&
|
||||
if (args.Using is {Valid: true} @using &&
|
||||
EntityManager.TryGetComponent<BuckleComponent?>(@using, out var usingBuckle) &&
|
||||
component.HasSpace(usingBuckle) &&
|
||||
_interactionSystem.InRangeUnobstructed(args.Using, args.Target, range: usingBuckle.Range))
|
||||
_interactionSystem.InRangeUnobstructed(@using, args.Target, range: usingBuckle.Range))
|
||||
{
|
||||
// Check that the entity is unobstructed from the target (ignoring the user).
|
||||
bool Ignored(IEntity entity) => entity == args.User || entity == args.Target || entity == args.Using;
|
||||
if (!_interactionSystem.InRangeUnobstructed(args.Using, args.Target, usingBuckle.Range, predicate: Ignored))
|
||||
bool Ignored(EntityUid entity) => entity == args.User || entity == args.Target || entity == @using;
|
||||
if (!_interactionSystem.InRangeUnobstructed(@using, args.Target, usingBuckle.Range, predicate: Ignored))
|
||||
return;
|
||||
|
||||
Verb verb = new();
|
||||
verb.Act = () => usingBuckle.TryBuckle(args.User, args.Target);
|
||||
verb.Category = VerbCategory.Buckle;
|
||||
verb.Text = IoCManager.Resolve<IEntityManager>().GetComponent<MetaDataComponent>(args.Using).EntityName;
|
||||
verb.Text = EntityManager.GetComponent<MetaDataComponent>(@using).EntityName;
|
||||
|
||||
// If the used entity is a person being pulled, prioritize this verb. Conversely, if it is
|
||||
// just a held object, the user is probably just trying to sit down.
|
||||
verb.Priority = IoCManager.Resolve<IEntityManager>().HasComponent<ActorComponent>(args.Using) ? 1 : -1;
|
||||
verb.Priority = EntityManager.HasComponent<ActorComponent>(@using) ? 1 : -1;
|
||||
|
||||
args.Verbs.Add(verb);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user