]> granicus.if.org Git - nethack/commitdiff
U704 - creating unappropriate hell random monsters
authorcohrs <cohrs>
Tue, 21 Oct 2003 16:20:18 +0000 (16:20 +0000)
committercohrs <cohrs>
Tue, 21 Oct 2003 16:20:18 +0000 (16:20 +0000)
When changing levels, the state of rndmonst() is reset, causing the monster
choices to be recalculated.  However, the frequency counts for initial
uncommon() monsters were never cleared.  Thus, if the first non-extinct
monster were a hell monster, and you returned to the main dungeon, the hell
monster will remain in the list and could be selected.

doc/fixes34.3
src/makemon.c

index 9614676ef450df679c38c417bb73e43937c288a5..9f624714159aa3745e42c2fb80798045e1c50aa9 100644 (file)
@@ -64,6 +64,7 @@ prevent boulder option from accepting a symbol that matches a monster symbol
 traveling while standing on a trap would sometime step in the wrong direction
 avoid traveling into water/lava, using usual running rules
 unchanging iron golem would still rehumanize in a rust trap
+fix an impossible rndmonst: bad `mndx' bug
 
 
 Platform- and/or Interface-Specific Fixes
index 123de5da1abf93db8fe4eaa476190bda655c0ca2..a6cd84f4207b61bdb2a5668105640a2ce255bdb5 100644 (file)
@@ -1170,8 +1170,10 @@ rndmonst()
 
            rndmonst_state.choice_count = 0;
            /* look for first common monster */
-           for (mndx = LOW_PM; mndx < SPECIAL_PM; mndx++)
+           for (mndx = LOW_PM; mndx < SPECIAL_PM; mndx++) {
                if (!uncommon(mndx)) break;
+               rndmonst_state.mchoices[mndx] = 0;
+           }           
            if (mndx == SPECIAL_PM) {
                /* evidently they've all been exterminated */
 #ifdef DEBUG