Fix ItemSlots error (#5439)
* fix duplicate slots * fix comment * comments
This commit is contained in:
@@ -8,6 +8,7 @@ using Robust.Shared.GameObjects;
|
||||
using Robust.Shared.GameStates;
|
||||
using Robust.Shared.IoC;
|
||||
using Robust.Shared.Localization;
|
||||
using Robust.Shared.Log;
|
||||
using Robust.Shared.Player;
|
||||
using Robust.Shared.Utility;
|
||||
using System.Collections.Generic;
|
||||
@@ -74,7 +75,8 @@ namespace Content.Shared.Containers.ItemSlots
|
||||
{
|
||||
var itemSlots = EntityManager.EnsureComponent<ItemSlotsComponent>(uid);
|
||||
slot.ContainerSlot = ContainerHelpers.EnsureContainer<ContainerSlot>(itemSlots.Owner, id);
|
||||
DebugTools.Assert(!itemSlots.Slots.ContainsKey(id));
|
||||
if (itemSlots.Slots.ContainsKey(id))
|
||||
Logger.Error($"Duplicate item slot key. Entity: {itemSlots.Owner.Name} ({uid}), key: {id}");
|
||||
itemSlots.Slots[id] = slot;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user