Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

Commit

Permalink
Fixed trackables not being tracked after dropping or changing item
Browse files Browse the repository at this point in the history
  • Loading branch information
NaoUnderscore committed Aug 23, 2024
1 parent 4fe057e commit de89528
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions Exiled.CustomModules/API/Features/Generic/TrackerBase.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ public virtual bool AddOrTrack(Pickup pickup)
if (trackableBehaviours.IsEmpty())
return false;

if (TrackedItemSerials.ContainsKey(pickup.Serial))
if (TrackedPickupSerials.ContainsKey(pickup.Serial))
{
IEnumerable<T> previousTrackableItems = TrackedPickupSerials[pickup.Serial];
TrackedPickupSerials[pickup.Serial].AddRange(trackableBehaviours.Cast<T>());
Expand Down Expand Up @@ -249,7 +249,8 @@ public virtual bool Restore(Pickup pickup, Item item)
/// <returns><see langword="true"/> if the item was restored successfully; otherwise, <see langword="false"/>.</returns>
public virtual bool Restore(Item item, Pickup pickup)
{
if (!pickup || !item || !TrackedPickupSerials.ContainsKey(pickup.Serial) || !TrackedItemSerials.ContainsKey(item.Serial))
if (!pickup || !item || !TrackedPickupSerials.ContainsKey(pickup.Serial) ||
!TrackedItemSerials.ContainsKey(item.Serial))
return false;

foreach (T behaviour in TrackedPickupSerials[pickup.Serial])
Expand Down

0 comments on commit de89528

Please sign in to comment.