]> granicus.if.org Git - nethack/commit
fix #K166 - role selection filtering
authorPatR <rankin@nethack.org>
Mon, 13 Jan 2020 20:34:01 +0000 (12:34 -0800)
committerPatR <rankin@nethack.org>
Mon, 13 Jan 2020 20:34:01 +0000 (12:34 -0800)
commit2b1f8a1b432911948cc6c40af2336b5d7f8a07b2
tree2f0774dc18f7bf417f18e6b84b1ef4fd73c8b8b0
parentc2060f9e8c48f0ef83d6f23456a6b0e9cf969ca8
fix #K166 - role selection filtering

pick_role() had a 5 year old copy+paste error where a pair of lines
were cloned multiple times but one of the resulting lines didn't get
the intended revision, preventing OPTIONS=align:!chaotic or !neutral
or !lawful from working as intended when letting the game choose role
randomly.  The bad line should have been calling ok_align() but that
routine turned out to have a bug too.

Fixing those lead to other less obvious problems with role selection,
particularly the tty menu version for picking manually.  Roles and/or
races which should have been excluded by partial specification weren't
always kept out.  Also, if any filtering was specified, trying to
disable all filters (via choosing 'reset filtering' and de-selecting
everything in the menu) was a no-op.  Once any filtering was in place
you had to leave at least one role or race or gender or alignment
flagged as not acceptable in order to change any of the filtering.
When that was fixed and it was possible to turn off all filtering,
there was no way to turn it back on because the menu choice to reset
the filters wasn't offered unless there was some filtering in place
(that was intentional but turned out not to be a good idea).

I checked curses and X11; they both offer less versatile selection
capability that don't seem to need the tty-specific fixes.
doc/fixes37.0
src/role.c
win/tty/wintty.c