artifact manipulation

Fix an item from <Someone>'s list:  invoking or applying an
artifact might blast you; if it evades your grasp, the intended
action won't take place but will still use up a turn.
This commit is contained in:
nethack.rankin
2002-08-01 23:20:34 +00:00
parent 7191f3b8a5
commit 9fa85b109b
3 changed files with 9 additions and 3 deletions

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)apply.c 3.4 2002/04/18 */
/* SCCS Id: @(#)apply.c 3.4 2002/08/01 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2731,6 +2731,10 @@ doapply()
obj = getobj(class_list, "use or apply");
if(!obj) return 0;
if (obj->oartifact && !touch_artifact(obj, &youmonst))
return 1; /* evading your grasp costs a turn; just be
grateful that you don't drop it as well */
if (obj->oclass == WAND_CLASS)
return do_break_wand(obj);

View File

@@ -1,4 +1,4 @@
/* SCCS Id: @(#)artifact.c 3.4 2002/03/22 */
/* SCCS Id: @(#)artifact.c 3.4 2002/08/01 */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -1096,7 +1096,8 @@ doinvoke()
register struct obj *obj;
obj = getobj(invoke_types, "invoke");
if(!obj) return 0;
if (!obj) return 0;
if (obj->oartifact && !touch_artifact(obj, &youmonst)) return 1;
return arti_invoke(obj);
}