private IEnumerator HandleSoldItem(PickupObject targetItem)
        {
            if (!targetItem)
            {
                m_currentlySellingAnItem = false; yield break;
            }
            while (m_currentlySellingAnItem)
            {
                yield return(null);
            }
            m_currentlySellingAnItem = true;
            targetItem.IsBeingSold   = true;
            float magnitude = (targetItem.sprite.WorldCenter - specRigidbody.UnitCenter).magnitude;

            if (!targetItem.sprite || magnitude > 1.8f)
            {
                targetItem.IsBeingSold   = false;
                m_currentlySellingAnItem = false;
                yield break;
            }
            IPlayerInteractable ixable = null;

            if (targetItem is PassiveItem)
            {
                PassiveItem passiveItem = targetItem as PassiveItem;
                passiveItem.GetRidOfMinimapIcon();
                ixable = (targetItem as PassiveItem);
            }
            else if (targetItem is Gun)
            {
                Gun gun = targetItem as Gun;
                gun.GetRidOfMinimapIcon();
                ixable = (targetItem as Gun);
            }
            else if (targetItem is PlayerItem)
            {
                PlayerItem playerItem = targetItem as PlayerItem;
                playerItem.GetRidOfMinimapIcon();
                ixable = (targetItem as PlayerItem);
            }
            if (ixable != null)
            {
                RoomHandler.unassignedInteractableObjects.Remove(ixable);
                GameManager.Instance.PrimaryPlayer.RemoveBrokenInteractable(ixable);
            }
            float          elapsed      = 0f;
            float          duration     = 0.5f;
            Vector3        startPos     = targetItem.transform.position;
            Vector3        finalOffset  = Vector3.zero;
            tk2dBaseSprite targetSprite = targetItem.GetComponentInChildren <tk2dBaseSprite>();

            if (targetSprite)
            {
                finalOffset = targetSprite.GetBounds().extents;
            }
            while (elapsed < duration)
            {
                elapsed += BraveTime.DeltaTime;
                if (!targetItem || !targetItem.transform)
                {
                    m_currentlySellingAnItem = false; yield break;
                }
                targetItem.transform.localScale = Vector3.Lerp(Vector3.one, new Vector3(0.01f, 0.01f, 1f), elapsed / duration);
                targetItem.transform.position   = Vector3.Lerp(startPos, startPos + new Vector3(finalOffset.x, 0f, 0f), elapsed / duration);
                yield return(null);
            }
            if (!targetItem || !targetItem.transform)
            {
                m_currentlySellingAnItem = false; yield break;
            }
            SellPitDweller.SendPlaymakerEvent("playerSoldSomething");
            int sellPrice = Mathf.Clamp(Mathf.CeilToInt(targetItem.PurchasePrice * SellValueModifier), 0, 200);

            if (targetItem.quality == PickupObject.ItemQuality.SPECIAL || targetItem.quality == PickupObject.ItemQuality.EXCLUDED)
            {
                sellPrice = 3;
            }
            LootEngine.SpawnCurrency(targetItem.sprite.WorldCenter, sellPrice, false);
            m_thingsSold++;
            if (targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Castle || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Catacombs || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Gungeon || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Forge || targetItem.PickupObjectId == GlobalItemIds.MasteryToken_Mines)
            {
                m_masteryRoundsSold++;
            }
            if (targetItem is Gun && targetItem.GetComponentInParent <DebrisObject>())
            {
                Destroy(targetItem.transform.parent.gameObject);
            }
            else
            {
                Destroy(targetItem.gameObject);
            }
            if (m_thingsSold >= 3 && m_masteryRoundsSold > 0)
            {
                StartCoroutine(HandleSellPitOpening());
            }
            m_currentlySellingAnItem = false;
            yield break;
        }