🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: net.games.hack
Article #91

Bix Fug

#91
From: mcdaniel
Date: Tue, 22 Jan 1985 04:40
83 lines
3065 bytes
Problem: When using the 'c' command, the user is asked
  		Do you want to name an individual object? [yn]
	However, the game does not verify that the reply is one of 'y'
	or 'n'.  In particular, if the reply is not 'y', it is assumed
	to be 'n'.
Fix:	Add an extra test in hack.do_name.c.  If reply is 'y', call one
	object; if 'n', call a class of objects; otherwise, exit the 'c'
	command.  Context diffs:

---------------------------------------------------------------------

*** old:hack.do_name.c	Mon Jan 21 01:43:28 1985
--- hack.do_name.c	Mon Jan 21 01:50:11 1985
***************
*** 134,139
  ddocall()
  {
  	register struct obj *obj;
  
  	pline("Do you want to name an individual object? [yn] ");
  	if(readchar() == 'y'){

--- 134,141 -----
  ddocall()
  {
  	register struct obj *obj;
+ 	/* bug fix: temp var needed */
+ 	char reply;
  
  	pline("Do you want to name an individual object? [yn] ");
  	/* bug fix: read into var, and accept only y or n */
***************
*** 136,142
  	register struct obj *obj;
  
  	pline("Do you want to name an individual object? [yn] ");
! 	if(readchar() == 'y'){
  		obj = getobj("#", "name");
  		if(obj) do_oname(obj);
  	} else {

--- 138,146 -----
  	char reply;
  
  	pline("Do you want to name an individual object? [yn] ");
! 	/* bug fix: read into var, and accept only y or n */
! 	reply = readchar();
! 	if(reply == 'y'){
  		obj = getobj("#", "name");
  		if(obj) do_oname(obj);
  	} else if (reply == 'n') {
***************
*** 139,145
  	if(readchar() == 'y'){
  		obj = getobj("#", "name");
  		if(obj) do_oname(obj);
! 	} else {
  		obj = getobj("?!=/", "call");
  		if(obj) docall(obj);
  	}

--- 143,149 -----
  	if(reply == 'y'){
  		obj = getobj("#", "name");
  		if(obj) do_oname(obj);
! 	} else if (reply == 'n') {
  		obj = getobj("?!=/", "call");
  		if(obj) docall(obj);
  	}

--------------------------------------------------------------------

If I am confused, ignorant, or wrong, please enlighten me.

UNIX is a trademark of ATT.  VAX and PDP are trademarks of Digital
Equipment Corp.  The opinions expressed above are my own, and are not
in any way indicative of the opinions of any other entity or group of
entities in this universe.  Void where taxed or prohibited by law.
This space for rent.  She bop, she bop.

Tim McDaniel
Usenet: ...{pur-ee|ihnp4|convex}!uiucdcs!mcdaniel
Csnet: mcdaniel%uiuc@csnet-relay.arpa (really!)
Technical Details
Message-ID: <141200001@uiucdcsb.UUCP>
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!inuxc!pur-ee!uiucdcsb!mcdaniel

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Posting-Version: Notesfiles $Revision: 1.6.2.17 $; site uiucdcsb.UUCP
Path: arc1-ca.pugleaf.net!utzoo!watmath!clyde!burl!ulysses!mhuxr!ihnp4!inuxc!pur-ee!uiucdcsb!mcdaniel
From: mcdaniel@uiucdcsb.UUCP
Newsgroups: net.games.hack
Subject: Bix Fug
Message-ID: <141200001@uiucdcsb.UUCP>
Date: Mon, 21-Jan-85 23:40:00 EST
Article-I.D.: uiucdcsb.141200001
Posted: Mon Jan 21 23:40:00 1985
Date-Received: Wed, 23-Jan-85 06:21:06 EST
Lines: 84
Nf-ID: #N:uiucdcsb:141200001:000:2407
Nf-From: uiucdcsb!mcdaniel    Jan 21 22:40:00 1985