setuwep, et al, cleanup

This commit is contained in:
cohrs
2002-01-10 06:52:05 +00:00
parent 46bd9b925c
commit 631df10a34
6 changed files with 8 additions and 16 deletions
-1
View File
@@ -2015,7 +2015,6 @@ struct obj *obj;
} else if ((Fumbling || Glib) && !rn2(5)) { } else if ((Fumbling || Glib) && !rn2(5)) {
pline_The("bullwhip slips out of your %s.", body_part(HAND)); pline_The("bullwhip slips out of your %s.", body_part(HAND));
dropx(obj); dropx(obj);
setuwep((struct obj *)0);
} else if (u.utrap && u.utraptype == TT_PIT) { } else if (u.utrap && u.utraptype == TT_PIT) {
/* /*
+1 -3
View File
@@ -641,9 +641,7 @@ litter()
while (otmp) { while (otmp) {
nextobj = otmp->nobj; nextobj = otmp->nobj;
if ((otmp != uball) && (rnd(capacity) <= (int)otmp->owt)) { if ((otmp != uball) && (rnd(capacity) <= (int)otmp->owt)) {
if (otmp == uwep) if (canletgo(otmp, "")) {
setuwep((struct obj *)0);
if ((otmp != uwep) && (canletgo(otmp, ""))) {
Your("%s you down the stairs.", Your("%s you down the stairs.",
aobjnam(otmp, "follow")); aobjnam(otmp, "follow"));
dropx(otmp); dropx(otmp);
-1
View File
@@ -224,7 +224,6 @@ dig()
case 0: if(!welded(uwep)) { case 0: if(!welded(uwep)) {
You("fumble and drop your %s.", xname(uwep)); You("fumble and drop your %s.", xname(uwep));
dropx(uwep); dropx(uwep);
setuwep((struct obj *)0);
} else { } else {
#ifdef STEED #ifdef STEED
if (u.usteed) if (u.usteed)
-1
View File
@@ -456,7 +456,6 @@ register struct obj *obj;
return(0); return(0);
} }
setuwep((struct obj *)0); setuwep((struct obj *)0);
if(uwep) return 0; /* lifesaved and rewielded */
} }
if(obj == uquiver) { if(obj == uquiver) {
setuqwep((struct obj *)0); setuqwep((struct obj *)0);
+7 -4
View File
@@ -635,10 +635,9 @@ register struct obj *obj;
long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic; long oldprop = u.uprops[objects[obj->otyp].oc_oprop].extrinsic;
int old_attrib; int old_attrib;
if (obj == uwep) setuwep((struct obj *) 0);
if (obj == uwep) setuwep((struct obj *) 0); if (obj == uswapwep) setuswapwep((struct obj *) 0);
if (obj == uswapwep) setuswapwep((struct obj *) 0); if (obj == uquiver) setuqwep((struct obj *) 0);
if (obj == uquiver) setuqwep((struct obj *) 0);
/* only mask out W_RING when we don't have both /* only mask out W_RING when we don't have both
left and right rings of the same type */ left and right rings of the same type */
@@ -1417,6 +1416,10 @@ doputon()
} }
if(otmp == uwep) if(otmp == uwep)
setuwep((struct obj *)0); 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(otmp->oclass == RING_CLASS || otmp->otyp == MEAT_RING) {
if(nolimbs(youmonst.data)) { if(nolimbs(youmonst.data)) {
You("cannot make the ring stick to your body."); You("cannot make the ring stick to your body.");
-6
View File
@@ -84,11 +84,6 @@ STATIC_DCL int FDECL(ready_weapon, (struct obj *));
* 5. Emptying the slot, by passing a null object. NEVER pass * 5. Emptying the slot, by passing a null object. NEVER pass
* zeroobj! * 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 * 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 * responsibility to handle that. It's also the caller's responsibility
* to print the appropriate messages. * to print the appropriate messages.
@@ -443,7 +438,6 @@ can_twoweapon()
Your("%s from your %s!", aobjnam(obj, "slip"), str); Your("%s from your %s!", aobjnam(obj, "slip"), str);
if (!Glib) if (!Glib)
obj->bknown = TRUE; obj->bknown = TRUE;
setuswapwep((struct obj *) 0);
dropx(obj); dropx(obj);
} else } else
return (TRUE); return (TRUE);