arnold@ucsfcgl.UUCP (Ken Arnold%CGL) (06/23/85)
Here is a fix to something which has annoyed the bejezus out of me
ever since we got hack, which is that you can only genocide monsters
whose symbols are letters. I have had desires to genocide daemons,
for example, but couldn't because the check for validity of input was
not to see if it was a known monster character, but just if it was
an upper or lower case letter or a '@'. Here is the context diff to
fix it.
----- CUT HERE -----
*** /tmp/,RCSt1007524 Tue Jun 18 16:19:41 1985
--- hack.read.c Mon May 27 16:45:59 1985
***************
*** 189,195
else do {
pline("What monster do you want to genocide (Type the letter)? ");
getlin(buf);
! } while(strlen(buf) != 1 || !letter(*buf));
if(!index(fut_geno, *buf))
charcat(fut_geno, *buf);
if(!index(genocided, *buf))
--- 189,195 -----
else do {
pline("What monster do you want to genocide (Type the letter)? ");
getlin(buf);
! } while(strlen(buf) != 1 || !monster(*buf));
if(!index(fut_geno, *buf))
charcat(fut_geno, *buf);
if(!index(genocided, *buf))
***************
*** 515,518
}
if(!on) seehx = 0;
#endif QUEST
}
--- 515,538 -----
}
if(!on) seehx = 0;
#endif QUEST
+ }
+
+ monster(ch)
+ register char ch;
+ {
+ register struct permonst *mp;
+ extern struct permonst pm_eel;
+
+ /*
+ * can't genocide certain monsters
+ */
+ if (ch == '1' || ch == '2' || ch == ' ')
+ return FALSE;
+
+ if (ch == pm_eel.mlet)
+ return TRUE;
+ for (mp = mons; mp < &mons[CMNUM+2]; mp++)
+ if (mp->mlet == ch)
+ return TRUE;
+ return FALSE;
}aeb@mcvax.UUCP (Andries Brouwer) (06/25/85)
Several people have complained about the fact that it was (is) impossible to genocide certain monsters. This is on purpose; I want to prevent that one, by wishing three times for 3 scrolls of genocide, can eliminate all the tough monsters. The distinction letters-nonletters is completely arbitrary, and if I made an explicit list of nongenocidable monsters it might look a bit different, but it *would* contain daemons.