Fix 3000 errors
This commit is contained in:
@@ -1,7 +1,6 @@
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using Content.Server.Items;
|
||||
using Content.Shared.Item;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
@@ -25,7 +24,7 @@ namespace Content.Server.Inventory.Components
|
||||
_inventory = Owner.EnsureComponent<InventoryComponent>();
|
||||
}
|
||||
|
||||
bool IInventoryController.CanEquip(Slots slot, IEntity entity, bool flagsCheck, [NotNullWhen(false)] out string? reason)
|
||||
bool IInventoryController.CanEquip(Slots slot, EntityUid entity, bool flagsCheck, [NotNullWhen(false)] out string? reason)
|
||||
{
|
||||
var slotMask = SlotMasks[slot];
|
||||
reason = null;
|
||||
|
||||
@@ -17,12 +17,12 @@ namespace Content.Server.Inventory.Components
|
||||
/// <param name="flagsCheck">Whether the entity passes default slot masks & flags checks.</param>
|
||||
/// <param name="reason">The translated reason why the item cannot be equiped, if this function returns false. Can be null.</param>
|
||||
/// <returns>True if the entity can be equipped, false otherwise</returns>
|
||||
bool CanEquip(Slots slot, IEntity entity, bool flagsCheck, [NotNullWhen(false)] out string? reason)
|
||||
bool CanEquip(Slots slot, EntityUid entity, bool flagsCheck, [NotNullWhen(false)] out string? reason)
|
||||
{
|
||||
reason = null;
|
||||
return flagsCheck;
|
||||
}
|
||||
|
||||
bool CanEquip(Slots slot, IEntity entity, bool flagsCheck) => CanEquip(slot, entity, flagsCheck, out _);
|
||||
bool CanEquip(Slots slot, EntityUid entity, bool flagsCheck) => CanEquip(slot, entity, flagsCheck, out _);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics.CodeAnalysis;
|
||||
using System.Linq;
|
||||
using Content.Server.Administration.Commands;
|
||||
using Content.Server.Clothing.Components;
|
||||
using Content.Server.Hands.Components;
|
||||
using Content.Server.Interaction;
|
||||
@@ -11,15 +10,9 @@ using Content.Server.Storage.Components;
|
||||
using Content.Shared.ActionBlocker;
|
||||
using Content.Shared.Acts;
|
||||
using Content.Shared.Inventory;
|
||||
using Content.Shared.Movement.Components;
|
||||
using Content.Shared.Movement.EntitySystems;
|
||||
using Content.Shared.Popups;
|
||||
using Content.Shared.Verbs;
|
||||
using Robust.Server.Console;
|
||||
using Robust.Server.GameObjects;
|
||||
using Robust.Server.Player;
|
||||
using Robust.Shared.Audio;
|
||||
using Robust.Shared.Console;
|
||||
using Robust.Shared.Containers;
|
||||
using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.IoC;
|
||||
@@ -69,7 +62,7 @@ namespace Content.Server.Inventory.Components
|
||||
{
|
||||
if (TryGetSlotItem(slot, out ItemComponent? item))
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) item.Owner);
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(item.Owner);
|
||||
}
|
||||
|
||||
RemoveSlot(slot);
|
||||
@@ -78,7 +71,7 @@ namespace Content.Server.Inventory.Components
|
||||
base.OnRemove();
|
||||
}
|
||||
|
||||
public IEnumerable<IEntity> GetAllHeldItems()
|
||||
public IEnumerable<EntityUid> GetAllHeldItems()
|
||||
{
|
||||
foreach (var (_, container) in _slotContainers)
|
||||
{
|
||||
@@ -192,7 +185,7 @@ namespace Content.Server.Inventory.Components
|
||||
public bool Equip(Slots slot, ItemComponent item, bool mobCheck = true) =>
|
||||
Equip(slot, item, mobCheck, out var _);
|
||||
|
||||
public bool Equip(Slots slot, IEntity entity, bool mobCheck = true) =>
|
||||
public bool Equip(Slots slot, EntityUid entity, bool mobCheck = true) =>
|
||||
Equip(slot, IoCManager.Resolve<IEntityManager>().GetComponent<ItemComponent>(entity), mobCheck);
|
||||
|
||||
/// <summary>
|
||||
@@ -250,7 +243,7 @@ namespace Content.Server.Inventory.Components
|
||||
public bool CanEquip(Slots slot, ItemComponent item, bool mobCheck = true) =>
|
||||
CanEquip(slot, item, mobCheck, out var _);
|
||||
|
||||
public bool CanEquip(Slots slot, IEntity entity, bool mobCheck = true) =>
|
||||
public bool CanEquip(Slots slot, EntityUid entity, bool mobCheck = true) =>
|
||||
CanEquip(slot, IoCManager.Resolve<IEntityManager>().GetComponent<ItemComponent>(entity), mobCheck);
|
||||
|
||||
/// <summary>
|
||||
@@ -403,7 +396,7 @@ namespace Content.Server.Inventory.Components
|
||||
/// The underlying Container System just notified us that an entity was removed from it.
|
||||
/// We need to make sure we process that removed entity as being unequipped from the slot.
|
||||
/// </summary>
|
||||
public void ForceUnequip(IContainer container, IEntity entity)
|
||||
public void ForceUnequip(IContainer container, EntityUid entity)
|
||||
{
|
||||
// make sure this is one of our containers.
|
||||
// Technically the correct way would be to enumerate the possible slot names
|
||||
@@ -554,7 +547,7 @@ namespace Content.Server.Inventory.Components
|
||||
}
|
||||
}
|
||||
|
||||
public override bool IsEquipped(IEntity item)
|
||||
public override bool IsEquipped(EntityUid item)
|
||||
{
|
||||
if (item == null) return false;
|
||||
foreach (var containerSlot in _slotContainers.Values)
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace Content.Server.Inventory
|
||||
// Helper method that deletes the item and returns false.
|
||||
bool DeleteItem()
|
||||
{
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity((EntityUid) item);
|
||||
IoCManager.Resolve<IEntityManager>().DeleteEntity(item);
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user