bryceco / nethack-cocoa

OS X tile port of NetHack-3.6 using the native Cocoa framework
11 stars 4 forks source link

New character generation always choose first valid sex and alignment #16

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
When starting a new game with random role, race, sex, and alignment, the first 
available sex and alignment are the selected ones.  This is a consequence of 
the consecutive calls to selectRowIndexes in selectInitialPlayer in 
PlayerSelectionWindowController.m  The first call to set the row index for role 
triggers that the window needs updating. That results in a call to setupOthers 
without a selectedRow for race.
The code for setupOthers should only be executed if ro is between 0 and 
cntRoles and ra is between 0 and cntRaces.

Original issue reported on code.google.com by mcmadman...@yahoo.com on 19 Dec 2011 at 2:46

GoogleCodeExporter commented 9 years ago
I noticed another bug with the character generation.  Because the state for the 
Male and Neutral radio buttons is set, it is possible to have two buttons 
return true for their state when setupOthers is first called.  If you make my 
suggested change you'll get a better distribution, but still will have things 
like human valkyries always being neutral because the first time setupOthers is 
called, both lawful and neutral are set.  Clearing the buttons in the .nib file 
fixes this issue.

Original comment by mcmadman...@yahoo.com on 2 Jan 2012 at 5:56

GoogleCodeExporter commented 9 years ago
Nice job. Fixed in r133.

Original comment by bryc...@gmail.com on 23 Feb 2012 at 5:48