From: nethack.rankin Date: Thu, 7 Nov 2002 03:55:51 +0000 (+0000) Subject: remove curse tweak X-Git-Tag: MOVE2GIT~2341 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=836d600080cf13995f7dc866d2863aeb2a5ab02a;p=nethack remove curse tweak When reading an uncursed scroll of remove curse, don't uncurse an item "worn" in the quiver slot unless it is actually ammo or other missile weapon. --- diff --git a/doc/fixes34.1 b/doc/fixes34.1 index 92778379c..43dc66b13 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -297,6 +297,8 @@ becoming confused, eg from nausia, while reading a spellbook should result level teleports should not be controlled if you're confused vault wall repair should remove traps subsequently created at affected spots don't reveal deity name when a high priest(ess) gives temple entry greeting +for ordinary remove curse, don't uncurse quivered object unless it is suitable + to be used as a quivered weapon (ammo or missile) Platform- and/or Interface-Specific Fixes diff --git a/src/read.c b/src/read.c index 67954ad87..ba8c4f496 100644 --- a/src/read.c +++ b/src/read.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)read.c 3.4 2002/10/04 */ +/* SCCS Id: @(#)read.c 3.4 2002/11/06 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -911,15 +911,43 @@ register struct obj *sobj; if (sobj->cursed) { pline_The("scroll disintegrates."); } else { - for (obj = invent; obj; obj = obj->nobj) - if (sobj->blessed || - (obj->owornmask && - ((obj->owornmask & ~W_SWAPWEP) || u.twoweap)) || + for (obj = invent; obj; obj = obj->nobj) { + long wornmask; +#ifdef GOLDOBJ + /* gold isn't subject to cursing and blessing */ + if (obj->oclass == COIN_CLASS) continue; +#endif + wornmask = (obj->owornmask & ~(W_BALL|W_ART|W_ARTI)); + if (wornmask && !sobj->blessed) { + /* handle a couple of special cases; we don't + allow auxiliary weapon slots to be used to + artificially increase number of worn items */ + if (obj == uswapwep) { + if (!u.twoweap) wornmask = 0L; + } else if (obj == uquiver) { + if (obj->oclass == WEAPON_CLASS) { + /* mergeable weapon test covers ammo, + missiles, spears, daggers & knives */ + if (!objects[obj->otyp].oc_merge) + wornmask = 0L; + } else if (obj->oclass == GEM_CLASS) { + /* possibly ought to check whether + alternate weapon is a sling... */ + if (!uslinging()) wornmask = 0L; + } else { + /* weptools don't merge and aren't + reasonable quivered weapons */ + wornmask = 0L; + } + } + } + if (sobj->blessed || wornmask || obj->otyp == LOADSTONE || (obj->otyp == LEASH && obj->leashmon)) { if(confused) blessorcurse(obj, 2); else uncurse(obj); } + } } if(Punished && !confused) unpunish(); update_inventory();