ModdedPurchaseKeeper

v0.1.1·Updated 2026-08-03

Fixes REPOLib-registered (modded) shop items being bought but not appearing in the level. Preserves modded purchase counts across REPOLib's per-level item re-registration.

About this mod Author’s original text

ModdedPurchaseKeeper

Fixes REPOLib-registered (modded) shop items being bought and charged but never appearing

in the level — e.g. EMLGunPlus coil guns, and any other modded purchasable item.

If you've ever bought a modded weapon in the shop, watched it take your money, then loaded

into the level to find it missing — this fixes that.

The bug

When you buy an item, the game records it in StatsManager.itemsPurchased, and at the start

of the next level ItemManager.GetPurchasedItems reads that list so the truck can respawn

what you own. But REPOLib re-registers its modded items on level transitions, and

StatsManager.AddItem resets itemsPurchased[name] = 0 for each one it registers — wiping

the purchase count of a modded item you just bought, before it can respawn. Vanilla items

never go through REPOLib's registration path, which is why only modded items disappear.

(Verified against EMLGunPlus coil guns on R.E.P.O. 0.4.4 / REPOLib 4.2.0.)

The fix

Instead of fighting REPOLib's re-registration, ModdedPurchaseKeeper keeps its own ledger of

what you actually bought (hooking StatsManager.ItemPurchase / SetItemPurchase) and

re-asserts the correct count in a prefix on ItemManager.GetPurchasedItems — the exact moment

the truck reads it. Whatever zeroed the value in between, it's correct when it matters. The

ledger is cleared on a genuine new-run reset (ResetAllStats), so purchases never leak

between runs, and it only ever raises a count back to what you paid for — it can't duplicate

items or interfere with consumables being used up.

No configuration. Load order is handled via a soft dependency on REPOLib.

Scope

Covers purchasable items (weapons, tools, carts, etc. — anything tracked by

itemsPurchased). Modded single-use upgrades use separate dictionaries and are out of scope.

Compatibility

  • R.E.P.O. 0.4.x
  • Requires REPOLib and BepInEx.
  • Safe alongside other shop mods (MoreShopItems, etc.) — it only reads/writes purchase counts.

Building

GAME_DIR=/path/to/REPO./package.sh

Produces builds/ModdedPurchaseKeeper-.zip and deploys the DLL to a local r2modman

profile for testing.

Install & use Install: BepInEx plugin

  1. The archive from playbuff is the mod itself — usually a BepInEx plugin (a .dll or a plugin folder once unzipped).
  2. Recommended: use a community mod manager (such as r2modman) — pick this game, import the mod, and the manager sets up BepInEx and its dependencies for you.
  3. Manual route: install the BepInEx loader in the game folder, then drop the unzipped .dll or plugin folder into BepInEx/plugins/.
  4. Launch the game — the BepInEx console logs every plugin it loads; seeing this mod in the log means it is installed.

Mods with listed dependencies need those installed too, or they will not load. Options are usually changed in-game or in the plugin's config file.

Dependencies

Install these first, or the mod will not work:

BepInEx-BepInExPackZehs-REPOLib

File & checksum

Filename
ModdedPurchaseKeeper-0.1.1.zip
File size
20.7 KiB