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.
This commit is contained in:
nethack.rankin
2003-08-14 02:25:36 +00:00
parent fad1cd4b88
commit f5b1090fdc
+3 -2
View File
@@ -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. */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */ /* NetHack may be freely redistributed. See license for details. */
@@ -797,10 +797,11 @@ struct obj *obj;
break; break;
case 5 : pline("%s!", Tobjnam(obj, "explode")); case 5 : pline("%s!", Tobjnam(obj, "explode"));
useup(obj); useup(obj);
obj = 0; /* it's gone */
losehp(rnd(30), "exploding crystal ball", KILLED_BY_AN); losehp(rnd(30), "exploding crystal ball", KILLED_BY_AN);
break; break;
} }
consume_obj_charge(obj, TRUE); if (obj) consume_obj_charge(obj, TRUE);
return; return;
} }