The pull request #226 commentary follows: One major limitation of the autopickup exception system is that you can't define an exception from an exception, despite both menucolors and msgtypes prioritizing rules based on the order they are defined in .nethackrc. This is because the "always pickup" and "never pickup" exceptions are tracked in different lists, and at runtime, when the player steps over an object, the game checks these lists seperately, with "never pickup" taking precedence. This means that if you want to pick up some but not all items matching a given expression, you may need to write a long and kludgy list of regexes to get the behavior you want. I've edited the autopickup exception code to remove this necessity: now the exceptions are stored in one list, and conflicts between them are resolved based on their relative position in that list. Whether an exception was inclusive or exclusive was already tracked individually; I don't know why they were stored separately in the first place. This edit makes the system both more convenient and more consistent with the semantics of menucolors and msgtypes. With these changes, the 33 autopickup exception rules in the wiki article linked above may be replaced with the following 7 much simpler rules for the exact same effect: AUTOPICKUP_EXCEPTION=">.* corpse.*" AUTOPICKUP_EXCEPTION="<.* newt corpse.*" AUTOPICKUP_EXCEPTION="<.* lichen corpse.*" AUTOPICKUP_EXCEPTION="<.* lizard corpse.*" AUTOPICKUP_EXCEPTION="<.* floating eye corpse.*" AUTOPICKUP_EXCEPTION="<.* wraith corpse.* AUTOPICKUP_EXCEPTION=">.*\>.*" closes #226
14 KiB
14 KiB