🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.games.hack
Article #812

Genocide scroll fix

#812
From: Ken Arnold%CGL
Date: Sun, 23 Jun 1985 01:00
62 lines
2192 bytes
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;
  }
Technical Details
Message-ID: <555@ucsfcgl.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!ucbvax!ucsfcgl!arnold

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: version B 2.10.2 9/18/84; site ucsfcgl.UUCP
Path: arc1-ca.pugleaf.net!utzoo!linus!decvax!ucbvax!ucsfcgl!arnold
From: arnold@ucsfcgl.UUCP (Ken Arnold%CGL)
Newsgroups: net.games.hack
Subject: Genocide scroll fix
Message-ID: <555@ucsfcgl.UUCP>
Date: Sat, 22-Jun-85 21:00:28 EDT
Article-I.D.: ucsfcgl.555
Posted: Sat Jun 22 21:00:28 1985
Date-Received: Mon, 24-Jun-85 20:24:07 EDT
Reply-To: arnold@ucsfcgl.UUCP (Ken Arnold)
Organization: UCSF Computer Graphics Lab
Lines: 62