Skip to content

Commit ddf956f

Browse files
committed
Removed the coroutine exception log patch
1 parent 076cae6 commit ddf956f

3 files changed

Lines changed: 7 additions & 612 deletions

File tree

LabExtended/API/Containers/EffectContainer.cs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,13 @@
44

55
using InventorySystem.Items.Usables.Scp244.Hypothermia;
66

7+
using LabExtended.API.Custom.Effects;
8+
79
using LabExtended.Core;
10+
using LabExtended.Core.Pooling.Pools;
11+
812
using LabExtended.Events;
913
using LabExtended.Extensions;
10-
using LabExtended.Core.Pooling.Pools;
1114

1215
using NorthwoodLib.Pools;
1316

@@ -16,8 +19,6 @@
1619
using LabApi.Events.Arguments.PlayerEvents;
1720

1821
using UnityEngine;
19-
using LabExtended.API.Custom.Effects;
20-
2122
// ReSharper disable UnusedAutoPropertyAccessor.Local
2223

2324
#pragma warning disable CS8618 // Non-nullable field must contain a non-null value when exiting constructor. Consider adding the 'required' modifier or declaring as nullable.

LabExtended/API/Containers/InventoryContainer.cs

Lines changed: 3 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -59,27 +59,11 @@ public ItemBase? this[ushort itemSerial]
5959
{
6060
if (value != null)
6161
{
62-
if (value.Owner != null)
63-
{
64-
value.OwnerInventory.UserInventory.Items.Remove(itemSerial);
65-
value.OwnerInventory.SendItemsNextFrame = true;
66-
67-
value.OnRemoved(null);
68-
}
69-
70-
value.Owner = Inventory._hub;
71-
value.OnAdded(null);
72-
73-
UserInventory.Items[itemSerial] = value;
74-
75-
Inventory.SendItemsNextFrame = true;
62+
value.TransferItem(Player.ReferenceHub);
7663
}
77-
else if (UserInventory.Items.TryGetValue(itemSerial, out var item)
78-
&& UserInventory.Items.Remove(itemSerial))
64+
else if (UserInventory.Items.TryGetValue(itemSerial, out var item))
7965
{
80-
item.OnRemoved(null);
81-
82-
Inventory.SendItemsNextFrame = true;
66+
item.DestroyItem();
8367
}
8468
}
8569
}
@@ -587,9 +571,6 @@ public int RemoveItems(Predicate<ItemBase>? predicate = null)
587571
/// <returns>The amount of removed items.</returns>
588572
public int RemoveItems(ItemType type, int count = 1, bool throwIfNotEnough = false)
589573
{
590-
if (count is < 1 or > 8)
591-
throw new ArgumentOutOfRangeException(nameof(count));
592-
593574
if (type is ItemType.None)
594575
return 0;
595576

0 commit comments

Comments
 (0)