From f5b1090fdc0a085388821847897d201cfd3c3655 Mon Sep 17 00:00:00 2001 From: "nethack.rankin" Date: Thu, 14 Aug 2003 02:25:36 +0000 Subject: [PATCH] fix B07001 - crystal ball bug Applying a cursed crystal ball has a chance of detroying it; the code to use up a charge wasn't taking that into account. --- src/detect.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/detect.c b/src/detect.c index f4211cd55..693d4d64d 100644 --- a/src/detect.c +++ b/src/detect.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)detect.c 3.4 2003/05/25 */ +/* SCCS Id: @(#)detect.c 3.4 2003/08/13 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -797,10 +797,11 @@ struct obj *obj; break; case 5 : pline("%s!", Tobjnam(obj, "explode")); useup(obj); + obj = 0; /* it's gone */ losehp(rnd(30), "exploding crystal ball", KILLED_BY_AN); break; } - consume_obj_charge(obj, TRUE); + if (obj) consume_obj_charge(obj, TRUE); return; } -- 2.40.0