Per category (Gold, Tränke, white/blue/yellow/brown/green items) one of Löschen (loot deleted at once), Ignorieren (pickup key leaves it), Standard, Immer anzeigen (label without the labels key). Replaces the game's PICKUPAUTO choice; settings in [loot] of sacredK.ini. docs/loot-filter.md. Also ignore MSYS *.stackdump files. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
4.0 KiB
Loot filter (Beute page)
Request (2026-10-19): on the options window's Beute tab, per category — Gold, Tränke, and the item colours white / blue / yellow / brown / green — one of:
- Löschen (Void): the drop is deleted at once;
- Ignorieren (Ignore): the pickup key leaves it;
- Standard (Default): picked up, label with the labels key (Alt);
- Immer anzeigen (Always Show): picked up, label without the key too.
Decided with the user: the filter replaces the game's PICKUPAUTO choice
(all / valuable / gold only; its radio buttons are hidden, the animation
checkbox stays); Void deletes loot only (monster drops, chests), not items
the player puts down. Settings: [loot] in sacredK.ini
(Gold=Default, keys Gold, Potions, White, Blue, Yellow, Brown, Green;
values Void, Ignore, Default, AlwaysShow). Code: src/mods/lootfilter.cpp,
page in src/mods/options.cpp.
What decides the category (read from the game)
- Gold:
0x43ae20(thiscall on the item type table, (type)): one of four types listed at0x947920. The labels show its amount, the collect mode takes it without inventory space, the loot drop sets the amount after creating it. - Potions: item class 9 (type table +0x2e).
- Item colour (
0x5c1330, the items' vf24 case 2): set items green (type group record0x433f00+0x23); otherwise, with the game'sUNIQUE_COLORoption (on by default), by the quality tier, bits 16..19 of the item's quality flags (+0x11c): up to 4 whiteffefefef, 5..11 blueffa0a0ff, 12..14 yellowfff0e040, 15 brownffc19a33; set greenff15ff25. (Without UNIQUE_COLOR, items with special bits get other colours from0x5c1260; the filter uses the tier regardless.) - Not filtered: runes (class 0x1c), objects with flag 0x800 and the types
0x428550reports (CanCollectItem always takes both; quest items, presumably).
Where it acts
- Pickup:
cCreature::CanCollectItem(0x4ec170, (item), ret 4) is the filter of the collect mode (0x4ec3a0, the pickup key's order 0x113): its ring scan and the follow-up scan next to a picked item. A clicked item does not ask it. Original: refuses carried items (+0x14 bit 2), takes the always-collected ones, then filters by PICKUPAUTO (0x819580; 1 by value against the hero level, 2 gold only). Now: carried → no; else by mode. - Void: the loot drop
cCreature 0x559a30((forced type, ?, ?, killer), ret 0x10; logsDrop from [%d] %s) makes its items withcObjectManager::CreateAt(0x5fbaa0, ret 0x14) and tosses them (0x44e0a0). Chests keep their contents as ids at +0x1e4/+0x1e8;cChest3D::dropItems(0x5c9b10, ret 4) throws them out. Ids from both are queued and handled on the next engine tick (the callers use the item after creating it, e.g.0x4d0f29uses the returned object): still on the map (no carried / dead flag) and Void →RemoveFromMap(0x5fc910) andDestroyObject(id, 0, 0, 0), as the loot drop itself replaces an item. Player drops go throughcEngine::dropItem(0x6116c0), not touched. - Always Show:
cWorldView0::DrawObjectLabels(0x627260, (renderer), ret 4) draws the labels list (+0x96b30, 0x1c per entry, +0 object id; an entry with the high bit set is skipped) only with the key held (it sets +0x10 bit 0x4000 from the key). Without the key, if an always-shown item is listed: all other entries are marked skipped, the key reads as held (input::ForceLabels), the original runs, the marks and bit 0x4000 go back. Clicking such a label without the key does not pick it up (PickObjectAt0x626d30uses its own list); clicking the item does.
The page
The auto-pickup frame (now only Animation) stays at the top left; below it,
across both columns, a framed table: a row per category (name in the game's
colour), a box per mode, the chosen one highlighted; the title "Beutefilter"
in the header row (above the frame it met the backdrop); hints at the bottom.
Changes are kept until OK (0x717460), Cancel drops them, like the key
bindings.