]> granicus.if.org Git - nethack/commitdiff
setuwep, et al, cleanup
authorcohrs <cohrs>
Thu, 10 Jan 2002 06:52:05 +0000 (06:52 +0000)
committercohrs <cohrs>
Thu, 10 Jan 2002 06:52:05 +0000 (06:52 +0000)
src/apply.c
src/ball.c
src/dig.c
src/do.c
src/do_wear.c
src/wield.c

index 874276d6d945ddf5d53d6f951a9cdb9e74fdd665..684906154e330597f5460a5879ae0bae364a0276 100644 (file)
@@ -2015,7 +2015,6 @@ struct obj *obj;
     } else if ((Fumbling || Glib) && !rn2(5)) {
        pline_The("bullwhip slips out of your %s.", body_part(HAND));
        dropx(obj);
-       setuwep((struct obj *)0);
 
     } else if (u.utrap && u.utraptype == TT_PIT) {
        /*
index 6f9536e97ddc6ffbfba5b3c8798f5ac7978ceb34..2d2269122a2d47008c8ed2705749144e1759a30d 100644 (file)
@@ -641,9 +641,7 @@ litter()
        while (otmp) {
                nextobj = otmp->nobj;
                if ((otmp != uball) && (rnd(capacity) <= (int)otmp->owt)) {
-                       if (otmp == uwep)
-                               setuwep((struct obj *)0);
-                       if ((otmp != uwep) && (canletgo(otmp, ""))) {
+                       if (canletgo(otmp, "")) {
                                Your("%s you down the stairs.",
                                     aobjnam(otmp, "follow"));
                                dropx(otmp);
index 62d6f51b0eb01bd9ee05201402c764caeaa48a66..7664c9ac8ace95d4b9f88c6f6d1618d917a1d228 100644 (file)
--- a/src/dig.c
+++ b/src/dig.c
@@ -224,7 +224,6 @@ dig()
                case 0:  if(!welded(uwep)) {
                             You("fumble and drop your %s.", xname(uwep));
                             dropx(uwep);
-                            setuwep((struct obj *)0);
                         } else {
 #ifdef STEED
                             if (u.usteed)
index 11b2c40c83f5a27e377e939968083a980318ccb4..1b1449cbe01ec069c9e84534881868583fec82c9 100644 (file)
--- a/src/do.c
+++ b/src/do.c
@@ -456,7 +456,6 @@ register struct obj *obj;
                        return(0);
                }
                setuwep((struct obj *)0);
-               if(uwep) return 0; /* lifesaved and rewielded */
        }
        if(obj == uquiver) {
                setuqwep((struct obj *)0);
index c14520df0d8fc6adbc8d0689b654d166475943cf..4df010c4c7423d513d0f10d70fb0c2174a7c4eb7 100644 (file)
@@ -635,10 +635,9 @@ register struct obj *obj;
     long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
     int old_attrib;
 
-
-       if (obj == uwep) setuwep((struct obj *) 0);
-       if (obj == uswapwep) setuswapwep((struct obj *) 0);
-       if (obj == uquiver) setuqwep((struct obj *) 0);
+    if (obj == uwep) setuwep((struct obj *) 0);
+    if (obj == uswapwep) setuswapwep((struct obj *) 0);
+    if (obj == uquiver) setuqwep((struct obj *) 0);
 
     /* only mask out W_RING when we don't have both
        left and right rings of the same type */
@@ -1417,6 +1416,10 @@ doputon()
        }
        if(otmp == uwep)
                setuwep((struct obj *)0);
+       if(otmp == uswapwep)
+               setuswapwep((struct obj *) 0);
+       if(otmp == uquiver)
+               setuqwep((struct obj *) 0);
        if(otmp->oclass == RING_CLASS || otmp->otyp == MEAT_RING) {
                if(nolimbs(youmonst.data)) {
                        You("cannot make the ring stick to your body.");
index 3479345f154abc70183c6761aa0ed41a2b1058bd..3b0293553c9fdfae5c30ce0de1c92228b508d034 100644 (file)
@@ -84,11 +84,6 @@ STATIC_DCL int FDECL(ready_weapon, (struct obj *));
  * 5.  Emptying the slot, by passing a null object.  NEVER pass
  *     zeroobj!
  *
- * Note: setuwep() with a null obj, and uwepgone(), are NOT the same!
- * Sometimes unwielding a weapon can kill you, and lifesaving will then
- * put it back into your hand.  If lifesaving is permitted to do this,
- * use setwuep((struct obj *)0); otherwise use uwepgone().
- *
  * If the item is being moved from another slot, it is the caller's
  * responsibility to handle that.  It's also the caller's responsibility
  * to print the appropriate messages.
@@ -443,7 +438,6 @@ can_twoweapon()
                Your("%s from your %s!",  aobjnam(obj, "slip"), str);
                if (!Glib)
                        obj->bknown = TRUE;
-               setuswapwep((struct obj *) 0);
                dropx(obj);
        } else
                return (TRUE);