🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

Article View: comp.sources.bugs
Article #844

nethack fixes

#844
From: Steven Grady
Date: Fri, 31 Jul 1987 02:35
71 lines
2443 bytes
The following diffs fix two bugs.  The change in wield.c prevents
a core dump from occurring (dereferencing through NULL) when you wield
something if you're currently empty-handed.  The change in invent.c
fixes the prompt for objects when REDO is #defined.  Just run this
article through "patch".

diff -c hack.old/invent.c hack/invent.c
*** hack.old/invent.c	Thu Jul 30 18:18:57 1987
--- hack/invent.c	Thu Jul 30 18:09:35 1987
***************
*** 366,382 ****
  		return(0);
  	}
  	for(;;) {
! 		if(!buf[0])
  #ifdef REDO
  		    if(!in_doagain)
  #endif
  			pline("What do you want to %s [*]? ", word);
! 		else
  #ifdef REDO
  		    if(!in_doagain)
  #endif
  			pline("What do you want to %s [%s or ?*]? ",
  				word, buf);
  
  		cnt = 0;
  		ilet = readchar();
--- 366,383 ----
  		return(0);
  	}
  	for(;;) {
! 		if(!buf[0]) {
  #ifdef REDO
  		    if(!in_doagain)
  #endif
  			pline("What do you want to %s [*]? ", word);
! 		} else {
  #ifdef REDO
  		    if(!in_doagain)
  #endif
  			pline("What do you want to %s [%s or ?*]? ",
  				word, buf);
+ 		}
  
  		cnt = 0;
  		ilet = readchar();
diff -c hack.old/wield.c hack/wield.c
*** hack.old/wield.c	Thu Jul 30 18:18:51 1987
--- hack/wield.c	Thu Jul 30 15:39:29 1987
***************
*** 126,132 ****
  
  int
  welded(obj) register struct obj *obj;  {
! 	return(obj == uwep && obj->cursed &&
  	       (obj->olet == WEAPON_SYM || obj->otyp == HEAVY_IRON_BALL ||
  		obj->otyp == CAN_OPENER || obj->otyp == PICK_AXE));
  }
--- 126,132 ----
  
  int
  welded(obj) register struct obj *obj;  {
! 	return(obj == uwep && (obj != (struct obj *) 0) && obj->cursed &&
  	       (obj->olet == WEAPON_SYM || obj->otyp == HEAVY_IRON_BALL ||
  		obj->otyp == CAN_OPENER || obj->otyp == PICK_AXE));
  }

	Steven
	grady@postgres.berkeley.edu
	...!ucbvax!grady
Technical Details
Message-ID: <3141@zen.berkeley.edu>
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!columbia!rutgers!ames!ucbcad!zen!postgres!grady

Show Full Headers
Complete Article Headers
Relay-Version: version B 2.10 5/3/83; site utzoo.UUCP
Path: arc1-ca.pugleaf.net!utzoo!mnetor!uunet!seismo!columbia!rutgers!ames!ucbcad!zen!postgres!grady
From: grady@postgres (Steven Grady)
Newsgroups: comp.sources.bugs
Subject: nethack fixes
Message-ID: <3141@zen.berkeley.edu>
Date: Thu, 30-Jul-87 22:35:58 EDT
Article-I.D.: zen.3141
Posted: Thu Jul 30 22:35:58 1987
Date-Received: Sat, 1-Aug-87 12:08:43 EDT
Sender: news@zen.berkeley.edu
Reply-To: grady@postgres (Steven Grady)
Distribution: world
Organization: Postgres Research Group, UC Berkeley
Lines: 71