Fix 3000 errors

This commit is contained in:
DrSmugleaf
2021-12-05 18:09:01 +01:00
parent 2bfec7ec62
commit 2a3b7d809d
569 changed files with 2979 additions and 3280 deletions

View File

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