Spelunky is © 2008, 2009 Derek Yu and Mossmouth, LLC, and is used under the [Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt). spelunky.ai is an unofficial fan project, not affiliated with or endorsed by Mossmouth. The game and its assets may not be sold.

Music by George Buzinkai and Jonathan Perry; sound effects made in SFXR. From Spelunky Classic 1.1, © 2008, 2009 Derek Yu and Mossmouth, LLC.

# Owned equipment for sale

From the spelunky.ai wiki: <https://spelunky.ai/wiki/owned-equipment-for-sale>. Verified against the spelunky.ai port [v0.1.13](https://github.com/851-labs/spelunky/releases/tag/v0.1.13) on 28 October 2026.

Owned equipment for sale is a quirk of Spelunky Classic in which a shop sells equipment the player already wears, and buying it gets him nothing.

| Quirk     |                                                                                                                                                                                                                 |
| --------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Status    | GML + Oracle                                                                                                                                                                                                    |
| Where     | [`scripts/scrShopItemsGen.gml:68-175`](https://spelunky.ai/wiki/source/scripts/scrShopItemsGen#L68-L175)                                                                                                        |
| Pinned by | `fidelity/replays/shop-seed-11-compass-restocked.txt`                                                                                                                                                           |
| Row       | [docs/quirks.md §1, Bugs and leftovers in the 1.1 source](https://github.com/851-labs/spelunky/blob/main/docs/quirks.md#1-bugs-and-leftovers-in-the-11-source): “Shops stock equipment the player already has.” |

Equipment in Spelunky Classic is worn for the rest of the game, so having one of each is all there is. But a
shop doesn't know what the player has: the [General Store](https://spelunky.ai/wiki/general-store), the [Clothing Shop](https://spelunky.ai/wiki/clothing-shop)
and the [Rare Shop](https://spelunky.ai/wiki/rare-shop) can all sell him a second [Compass](https://spelunky.ai/wiki/compass), pair of Spectacles or Gloves, and
paying for it spends the money on nothing.

## What happens

The player got a Compass from [Kali](https://spelunky.ai/wiki/kalis-favour) on level 9, and wears it. Level 10's General Store sells
another, and when he picks it up, the Shopkeeper prices it: "A COMPASS FOR $5400."[^1].

**Clip: A shop sells a Compass the player already wears.** Level 10 loads with the player wearing the Compass Kali gave him on level 9. The General Store beside him sells another, and he picks it up: "A COMPASS FOR $5400." ([video](https://spelunky.ai/wiki/media/clips/quirks/shop-compass-restocked/clip.mp4))

## Why

Each shop picks its wares at random, and for a piece of equipment it only checks that the level has no
instance of it yet:

```gml scripts/scrShopItemsGen.gml:169-172
        else if (rand(1,10) == 1)
        {
            if (not instance_exists(oCompass)) { obj = instance_create(xpos+8, ypos+10, oCompass); break; }
        }
```

[`scripts/scrShopItemsGen.gml:169-172`](https://spelunky.ai/wiki/source/scripts/scrShopItemsGen#L169-L172), from `spelunky.gmk`, Spelunky Classic 1.1's source, © 2008, 2009 Derek Yu and Mossmouth, LLC ([Spelunky User License v1.1b](https://spelunky.ai/LICENSE.txt)).

That keeps a level to one of each, but it never looks at `global.hasCompass`, or any of the other flags that say
what the player wears[^2]. The Clothing Shop's and the Rare Shop's equipment are checked the same
way[^3]. Paying for a ware takes the money and runs the same code as
carrying it out[^4], and for equipment, that only sets its flag,
which is already set[^5]. Kali's gift does it right: it skips the
equipment the player has[^6].

## Reproducing it

Get a piece of equipment, then find a shop on a later level that stocks the same one. It happens in normal play,
on any level after the one the equipment came from. The replay of the clip gets a Compass from Kali on level 9
(frame 1111), and level 10's General Store stocks another (1961). The player picks it up, and the Shopkeeper
offers it for $5,400, though he wears one (2028); he hasn't the money to buy it[^7].

## In the port

The spelunky.ai port reproduces it exactly: it's in docs/quirks.md's list of the 1.1 source's bugs[^2], and the oracle's fingerprint of the replay pins the second Compass. No option turns it off.

## FAQ

### Why is a shop selling a Compass I already have in Spelunky Classic?

Shops never check what the player wears. Each piece of equipment a shop picks is stocked as long as the level has no other one lying around, so a Compass, Spectacles, Gloves or any other worn item can be on sale again on any level after the one he got it on.

### What happens if you buy equipment you already have?

The money is spent and nothing changes: buying it, or carrying it out of the shop, only marks the item as worn again, which it already was.

### Does Kali give you equipment you already have?

No. Kali's first gift is picked from the eight pieces of equipment, skipping the ones the player has, so only shops make this mistake.

## See also

- **Related:** [General Store](https://spelunky.ai/wiki/general-store), [Clothing Shop](https://spelunky.ai/wiki/clothing-shop), [Rare Shop](https://spelunky.ai/wiki/rare-shop), [Compass](https://spelunky.ai/wiki/compass), [Kali's favour](https://spelunky.ai/wiki/kalis-favour)

## References

[^1]: Clip quirks/shop-compass-restocked

[^2]: Quirk 1 (docs/quirks.md)

[^3]: [`scripts/scrShopItemsGen.gml:68-175`](https://spelunky.ai/wiki/source/scripts/scrShopItemsGen#L68-L175)

[^4]: [`objects/oPlayer1/step.gml:1377-1384`](https://spelunky.ai/wiki/source/objects/oPlayer1/step#L1377-L1384)

[^5]: [`scripts/scrStealItem.gml:126-170`](https://spelunky.ai/wiki/source/scripts/scrStealItem#L126-L170)

[^6]: [`scripts/scrGetFavorMsg.gml:85-98`](https://spelunky.ai/wiki/source/scripts/scrGetFavorMsg#L85-L98)

[^7]: Replay `fidelity/replays/shop-seed-11-compass-restocked.txt`

### Source code

- [`scripts/scrShopItemsGen.gml`](https://spelunky.ai/wiki/source/scripts/scrShopItemsGen)
- [`scripts/scrStealItem.gml`](https://spelunky.ai/wiki/source/scripts/scrStealItem)
- [`objects/oPlayer1/step.gml`](https://spelunky.ai/wiki/source/objects/oPlayer1/step)
- [`scripts/scrGetFavorMsg.gml`](https://spelunky.ai/wiki/source/scripts/scrGetFavorMsg)
