And a bunch more.

This commit is contained in:
Vera Aguilera Puerto
2021-12-08 12:09:43 +01:00
parent 9b9babd429
commit 680ad72939
30 changed files with 176 additions and 125 deletions

View File

@@ -22,6 +22,8 @@ namespace Content.Client.Inventory
[ComponentReference(typeof(SharedInventoryComponent))]
public class ClientInventoryComponent : SharedInventoryComponent
{
[Dependency] private readonly IEntityManager _entMan = default!;
private readonly Dictionary<Slots, EntityUid> _slots = new();
public IReadOnlyDictionary<Slots, EntityUid> AllSlots => _slots;
@@ -92,7 +94,7 @@ namespace Content.Client.Inventory
foreach (var (slot, entity) in state.Entities)
{
if (!IoCManager.Resolve<IEntityManager>().EntityExists(entity))
if (!_entMan.EntityExists(entity))
{
continue;
}
@@ -136,7 +138,7 @@ namespace Content.Client.Inventory
return;
}
if (IoCManager.Resolve<IEntityManager>().TryGetComponent(entity, out ClothingComponent? clothing))
if (_entMan.TryGetComponent(entity, out ClothingComponent? clothing))
{
var flag = SlotMasks[slot];
var data = clothing.GetEquippedStateInfo(flag, SpeciesId);