Make protect_charms_from_sell actually configurable

It already read Config().char.get("protect_charms_from_sell", True) in
personal.py's drop/sell guard, but the key was never added to the char
config dict builder in config.py, so setting it in an ini file did
nothing — charms were unconditionally undroppable regardless of the
pickit verdict. Wired it up the same way protect_shields_from_sell
already works. Defaults to 1 (protected, unchanged behavior) so this
is opt-in only.
This commit is contained in:
FiskenPoul
2026-07-12 18:29:58 +02:00
parent 0eca544d2e
commit 05df847933
2 changed files with 5 additions and 0 deletions

View File

@@ -371,6 +371,10 @@ runs_per_stash=4
sell_junk=1
; protect_shields_from_sell: 1 = never vendor items with "shield" in detected name (recommended safety)
protect_shields_from_sell=1
; protect_charms_from_sell: 1 = never drop/vendor charms regardless of pickit verdict
; (recommended safety — a misread charm can't be un-dropped). Set to 0 to let your
; pickit rules decide keep/discard for charms same as any other item.
protect_charms_from_sell=1
; pick_rares_for_gold: 1 = pick all yellow (rare) ground items; non-keep rares will be sold
; Requires sell_junk=1 to convert extra pickups into gold.
pick_rares_for_gold=0

View File

@@ -376,6 +376,7 @@ class Config:
"gamble_items": False if not self._select_val("char", "gamble_items") else self._select_val("char", "gamble_items").replace(" ","").split(","),
"sell_junk": bool(int(self._select_val("char", "sell_junk"))),
"protect_shields_from_sell": bool(int(self._select_optional("char", "protect_shields_from_sell", "1"))),
"protect_charms_from_sell": bool(int(self._select_optional("char", "protect_charms_from_sell", "1"))),
"pick_rares_for_gold": bool(int(self._select_optional("char", "pick_rares_for_gold", "0"))),
"pick_gold": bool(int(self._select_optional("char", "pick_gold", "1"))),
"enable_no_pickup": bool(int(self._select_val("char", "enable_no_pickup"))),