So, the /ipurge command with window selection (inv, equip, ds, belt) has been floating around for a while... Nothing new there. But I always found it a bit annoying that if you wanted to clear just one inventory page, you couldn't. It's either nuke everything or nothing.
So I extended it.
Now you can do /ip inv 2 and only page 2 gets wiped. Small thing, but handy when you're testing stuff and don't want to lose that one page where you keep your "don't delete these" items.
We've all been there, ig.
See it here:
GIF
GIF
What's new here
Code:
/ip inv 1 → clears only page 1 (slots 0-44)
/ip inv 2 → clears only page 2 (slots 45-89)
/ip inv 3 → clears only page 3 (slots 90-134)
/ip inv 4 → clears only page 4 (slots 135-179)Code:
startSlot = (page - 1) * INVENTORY_PAGE_SIZE;
endSlot = page * INVENTORY_PAGE_SIZE;The page count depends on whether you're running extended inventory or not (INVENTORY_PAGE_COUNT will be 2, 4 or more. It depends how many you have).
Find do_item_purge and replace it with ((in game/src/cmd_gm.cpp)):
Registering the command
In cmd.cpp, make sure these entries exist in the command table (they should.. If not, you made something weird before or your files are questionable):Quick reference
Technical notes for dummies
- SyncQuickslot is called after each removal to clean up any quickslot references.. Otherwise you'd end up with ghost slots pointing to deleted items.- ComputePoints() runs at the start and end to recalculate character stats properly. Removing equipped items affects bonuses, so this keeps everything in sync (safety ig).
- The #define ENABLE_CMD_IPURGE_EX wraps the extended version. If you ever need to fall back to the basic "delete everything" behavior, just comment it out.
Final note
I've taken a lot from this forum, so figured I'd contribute back. Not sharing this elsewhere myself. If you do, just add credits... That's it, there's no big deal about a simple improvement anyway.

la acest mesaj și conținutul se va afișa automat.