Content update for NetEntities (#18935)
This commit is contained in:
@@ -8,13 +8,13 @@ namespace Content.Shared.Inventory.Events;
|
||||
[NetSerializable, Serializable]
|
||||
public sealed class InventoryEquipActEvent : EntityEventArgs
|
||||
{
|
||||
public readonly EntityUid Uid;
|
||||
public readonly EntityUid ItemUid;
|
||||
public readonly NetEntity Uid;
|
||||
public readonly NetEntity ItemUid;
|
||||
public readonly string Slot;
|
||||
public readonly bool Silent;
|
||||
public readonly bool Force;
|
||||
|
||||
public InventoryEquipActEvent(EntityUid uid, EntityUid itemUid, string slot, bool silent = false, bool force = false)
|
||||
public InventoryEquipActEvent(NetEntity uid, NetEntity itemUid, string slot, bool silent = false, bool force = false)
|
||||
{
|
||||
Uid = uid;
|
||||
ItemUid = itemUid;
|
||||
|
||||
@@ -360,7 +360,7 @@ public abstract partial class InventorySystem
|
||||
}
|
||||
|
||||
//we need to do this to make sure we are 100% removing this entity, since we are now dropping dependant slots
|
||||
if (!force && !slotContainer.CanRemove(removedItem.Value))
|
||||
if (!force && !_containerSystem.CanRemove(removedItem.Value, slotContainer))
|
||||
return false;
|
||||
|
||||
foreach (var slotDef in GetSlots(target, inventory))
|
||||
@@ -426,14 +426,12 @@ public abstract partial class InventorySystem
|
||||
if ((containerSlot == null || slotDefinition == null) && !TryGetSlotContainer(target, slot, out containerSlot, out slotDefinition, inventory))
|
||||
return false;
|
||||
|
||||
if (containerSlot.ContainedEntity == null)
|
||||
if (containerSlot.ContainedEntity is not {} itemUid)
|
||||
return false;
|
||||
|
||||
if (!containerSlot.ContainedEntity.HasValue || !containerSlot.CanRemove(containerSlot.ContainedEntity.Value))
|
||||
if (!_containerSystem.CanRemove(itemUid, containerSlot))
|
||||
return false;
|
||||
|
||||
var itemUid = containerSlot.ContainedEntity.Value;
|
||||
|
||||
// make sure the user can actually reach the target
|
||||
if (!CanAccess(actor, target, itemUid))
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user