]> granicus.if.org Git - nethack/commit
fix #H4246 - nasty() bugs
authorPatR <rankin@nethack.org>
Sat, 20 Feb 2016 02:15:45 +0000 (18:15 -0800)
committerPatR <rankin@nethack.org>
Sat, 20 Feb 2016 02:15:45 +0000 (18:15 -0800)
commit07f8488bbf3dd86329cc5db79802fd2d8e4be2ce
tree89331849cf757afb259370f8e27e76fbe8ee3eec
parent552b73b3f05fea024b5c0c3c7cac9d2410bf1f3c
fix #H4246 - nasty() bugs

In theory nasty() could summon 200 critters at a time, although the
chance seems fairly remote.  But it was biased towards having lawfuls
summon more critters than others since there are fewer lawfuls in the
nasties[] list.  This puts a cap of 8 successful makemon() calls,
enough to completely surround the hero.  More than 8 monsters can be
generated, if any of the makemon() calls produces a group.  (I think
fire giants are the only thing in nasties[] that ever come in groups.)
It's still biased toward lawful summoners trying more times hoping to
produce a lawful creature and generating chaotic ones in the process.

The bug report also thought there was some problem between chaotic
and unaligned or with the Wizard, but unaligned is treated as if it
were chaotic (due to use of sgn() in the two or three places where
alignment type is manipulated) so that isn't an actual problem.
doc/fixes36.1
src/wizard.c