Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

same to dev #2206

Merged
merged 3 commits into from
Nov 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Exiled.API/Features/Items/Scp330.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ public Scp330(Scp330Bag itemBase)
internal Scp330()
: this((Scp330Bag)Server.Host.Inventory.CreateItemInstance(new(ItemType.SCP330, 0), false))
{
Base.Candies.Add(Scp330Candies.GetRandom());
}

/// <summary>
Expand Down Expand Up @@ -278,7 +279,6 @@ public override Item Clone()
internal override void ChangeOwner(Player oldOwner, Player newOwner)
{
Base.Owner = newOwner.ReferenceHub;
Base.ServerRefreshBag();
}
}
}
12 changes: 2 additions & 10 deletions Exiled.API/Features/Player.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2461,19 +2461,11 @@ public Item AddItem(ItemBase itemBase, Item item = null)

item.ChangeOwner(item.Owner, this);

if (Inventory.isLocalPlayer && itemBase is IAcquisitionConfirmationTrigger acquisitionConfirmationTrigger)
if (itemBase is IAcquisitionConfirmationTrigger acquisitionConfirmationTrigger)
{
acquisitionConfirmationTrigger.ServerConfirmAcqusition();
acquisitionConfirmationTrigger.AcquisitionAlreadyReceived = true;
acquisitionConfirmationTrigger.AcquisitionAlreadyReceived = false;
}

// Dont care, didnt ask, ratio
Timing.CallDelayed(0.02f, () =>
{
if (item.Type is ItemType.SCP330 && item.Base != null)
((Scp330)item).Base.ServerRefreshBag();
});

ItemsValue.Add(item);

Inventory.SendItemsNextFrame = true;
Expand Down
Loading