Fix 3000 errors
This commit is contained in:
@@ -1,11 +1,9 @@
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Pulling;
|
||||
using Content.Shared.Hands;
|
||||
using Content.Shared.Hands.Components;
|
||||
using Content.Shared.Interaction;
|
||||
using JetBrains.Annotations;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
|
||||
namespace Content.Server.Hands.Systems
|
||||
{
|
||||
@@ -32,9 +30,9 @@ namespace Content.Server.Hands.Systems
|
||||
if (!hand.IsEmpty)
|
||||
continue;
|
||||
|
||||
var pos = IoCManager.Resolve<IEntityManager>().GetComponent<TransformComponent>(hands.Owner).Coordinates;
|
||||
var pos = EntityManager.GetComponent<TransformComponent>(hands.Owner).Coordinates;
|
||||
var virtualItem = EntityManager.SpawnEntity("HandVirtualItem", pos);
|
||||
var virtualItemComp = IoCManager.Resolve<IEntityManager>().GetComponent<HandVirtualItemComponent>(virtualItem);
|
||||
var virtualItemComp = EntityManager.GetComponent<HandVirtualItemComponent>(virtualItem);
|
||||
virtualItemComp.BlockingEntity = blockingEnt;
|
||||
hands.PutEntityIntoHand(hand, virtualItem);
|
||||
return true;
|
||||
@@ -74,7 +72,7 @@ namespace Content.Server.Hands.Systems
|
||||
var targEv = new VirtualItemDeletedEvent(comp.BlockingEntity, user);
|
||||
RaiseLocalEvent(comp.BlockingEntity, targEv, false);
|
||||
|
||||
IoCManager.Resolve<IEntityManager>().QueueDeleteEntity((EntityUid) comp.Owner);
|
||||
EntityManager.QueueDeleteEntity(comp.Owner);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
@@ -83,23 +81,22 @@ namespace Content.Server.Hands.Systems
|
||||
/// </summary>
|
||||
public void DeleteInHandsMatching(EntityUid user, EntityUid matching)
|
||||
{
|
||||
if (EntityManager.TryGetComponent<HandsComponent>(user, out var hands))
|
||||
{
|
||||
foreach (var handName in hands.ActivePriorityEnumerable())
|
||||
{
|
||||
var hand = hands.GetHand(handName);
|
||||
if (hand.IsEmpty)
|
||||
continue;
|
||||
if (!EntityManager.TryGetComponent<HandsComponent>(user, out var hands))
|
||||
return;
|
||||
|
||||
if (hand.HeldEntity != null)
|
||||
{
|
||||
if (EntityManager.TryGetComponent<HandVirtualItemComponent>(hand.HeldEntity,
|
||||
out var virt)
|
||||
&& virt.BlockingEntity == matching)
|
||||
{
|
||||
Delete(virt, user);
|
||||
}
|
||||
}
|
||||
foreach (var handName in hands.ActivePriorityEnumerable())
|
||||
{
|
||||
var hand = hands.GetHand(handName);
|
||||
if (hand.IsEmpty)
|
||||
continue;
|
||||
|
||||
if (hand.HeldEntity == default)
|
||||
continue;
|
||||
|
||||
if (EntityManager.TryGetComponent<HandVirtualItemComponent>(hand.HeldEntity, out var virt)
|
||||
&& virt.BlockingEntity == matching)
|
||||
{
|
||||
Delete(virt, user);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user