From: nethack.allison Date: Tue, 21 Dec 2004 16:40:14 +0000 (+0000) Subject: obj->quan bits X-Git-Tag: MOVE2GIT~1378 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6596b69111868f754d59c40b964cd6e9bfa46f13;p=nethack obj->quan bits --- diff --git a/src/apply.c b/src/apply.c index b527b126a..afa88aa92 100644 --- a/src/apply.c +++ b/src/apply.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)apply.c 3.4 2004/06/12 */ +/* SCCS Id: @(#)apply.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1135,7 +1135,7 @@ struct obj *obj; /* if it catches while you have it, then it's your tough luck */ check_unpaid(obj); verbalize("That's in addition to the cost of %s %s, of course.", - yname(obj), obj->quan == 1 ? "itself" : "themselves"); + yname(obj), obj->quan == 1L ? "itself" : "themselves"); bill_dummy_object(obj); } begin_burn(obj, FALSE); @@ -1987,7 +1987,7 @@ struct obj *tstone; } #endif - if (obj == tstone && obj->quan == 1) { + if (obj == tstone && obj->quan == 1L) { You_cant("rub %s on itself.", the(xname(obj))); return; } @@ -2001,7 +2001,7 @@ struct obj *tstone; pline("Oh, wow, look at the pretty shards."); else pline("A sharp crack shatters %s%s.", - (obj->quan > 1) ? "one of " : "", the(xname(obj))); + (obj->quan > 1L) ? "one of " : "", the(xname(obj))); #ifndef GOLDOBJ /* assert(obj != &goldobj); */ #endif diff --git a/src/dothrow.c b/src/dothrow.c index ef3495d66..b085b7e8f 100644 --- a/src/dothrow.c +++ b/src/dothrow.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)dothrow.c 3.4 2004/11/11 */ +/* SCCS Id: @(#)dothrow.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1689,7 +1689,7 @@ boolean in_view; You_hear("%s shatter!", something); else pline("%s shatter%s%s!", Doname2(obj), - (obj->quan==1) ? "s" : "", to_pieces); + (obj->quan==1L) ? "s" : "", to_pieces); break; case EGG: case MELON: diff --git a/src/end.c b/src/end.c index 2ffb78cb6..22cb0a506 100644 --- a/src/end.c +++ b/src/end.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)end.c 3.4 2004/12/17 */ +/* SCCS Id: @(#)end.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1005,8 +1005,8 @@ boolean identified, all_containers; } else { if (cat || deadcat) { pline("%s%s contains Schroedinger's %scat!", - (box->quan > 1) ? "One of the " : "", - (box->quan > 1) ? xname(box) : upstart(xname(box)), + (box->quan > 1L) ? "One of the " : "", + (box->quan > 1L) ? xname(box) : upstart(xname(box)), (deadcat) ? "dead " : ""); display_nhwindow(WIN_MESSAGE, FALSE); } diff --git a/src/explode.c b/src/explode.c index 1ebf8715b..72862d1b3 100644 --- a/src/explode.c +++ b/src/explode.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)explode.c 3.4 2004/06/12 */ +/* SCCS Id: @(#)explode.c 3.4 2004/12/21 */ /* Copyright (C) 1990 by Ken Arromdee */ /* NetHack may be freely redistributed. See license for details. */ @@ -428,7 +428,7 @@ struct obj *obj; /* only scatter this obj */ while ((otmp = individual_object ? obj : level.objects[sx][sy]) != 0) { if (otmp->quan > 1L) { - qtmp = otmp->quan - 1; + qtmp = otmp->quan - 1L; if (qtmp > LARGEST_INT) qtmp = LARGEST_INT; qtmp = (long)rnd((int)qtmp); otmp = splitobj(otmp, qtmp); diff --git a/src/mhitu.c b/src/mhitu.c index ecd9d7006..537a7fb20 100644 --- a/src/mhitu.c +++ b/src/mhitu.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)mhitu.c 3.4 2004/12/20 */ +/* SCCS Id: @(#)mhitu.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -104,7 +104,7 @@ register struct obj *otemp; return; pline("%s %s %s%s %s.", Monnam(mtmp), (objects[otemp->otyp].oc_dir & PIERCE) ? "thrusts" : "swings", - (otemp->quan > 1) ? "one of " : "", + (otemp->quan > 1L) ? "one of " : "", mhis(mtmp), xname(otemp)); } diff --git a/src/potion.c b/src/potion.c index cd77eca36..7af1c66e9 100644 --- a/src/potion.c +++ b/src/potion.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)potion.c 3.4 2004/09/22 */ +/* SCCS Id: @(#)potion.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -1991,7 +1991,7 @@ dodip() char oldbuf[BUFSZ], newbuf[BUFSZ]; short old_otyp = potion->otyp; boolean old_dknown = FALSE; - boolean more_than_one = potion->quan > 1; + boolean more_than_one = potion->quan > 1L; oldbuf[0] = '\0'; if (potion->dknown) { diff --git a/src/shk.c b/src/shk.c index 07eb9d7ab..66bd71cd7 100644 --- a/src/shk.c +++ b/src/shk.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)shk.c 3.4 2004/11/17 */ +/* SCCS Id: @(#)shk.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2137,7 +2137,7 @@ const char *arg; if (was_unknown) { Sprintf(fmtbuf, "%%s; you %s", fmt); obj_name[0] = highc(obj_name[0]); - pline(fmtbuf, obj_name, (obj->quan > 1) ? "them" : "it", + pline(fmtbuf, obj_name, (obj->quan > 1L) ? "them" : "it", amt, plur(amt), arg); } else { You(fmt, obj_name, amt, plur(amt), arg); @@ -3073,7 +3073,7 @@ boolean catchup; /* restoring a level */ /* convert to an object */ otmp = mksobj((ttmp->ttyp == LANDMINE) ? LAND_MINE : BEARTRAP, TRUE, FALSE); - otmp->quan= 1; + otmp->quan= 1L; otmp->owt = weight(otmp); (void) mpickobj(shkp, otmp); } diff --git a/src/sit.c b/src/sit.c index 9846f4e50..625e58137 100644 --- a/src/sit.c +++ b/src/sit.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)sit.c 3.4 2002/09/21 */ +/* SCCS Id: @(#)sit.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -301,7 +301,7 @@ dosit() uegg = mksobj(EGG, FALSE, FALSE); uegg->spe = 1; - uegg->quan = 1; + uegg->quan = 1L; uegg->owt = weight(uegg); uegg->corpsenm = egg_type_from_parent(u.umonnum, FALSE); uegg->known = uegg->dknown = 1; diff --git a/src/trap.c b/src/trap.c index 2ad66652d..bcc875ef6 100644 --- a/src/trap.c +++ b/src/trap.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)trap.c 3.4 2004/11/11 */ +/* SCCS Id: @(#)trap.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -2729,14 +2729,14 @@ xchar x, y; } dindx = (obj->oclass == SCROLL_CLASS) ? 2 : 3; if (in_sight) - pline("%s %s.", Yname2(obj), (obj->quan > 1) ? + pline("%s %s.", Yname2(obj), (obj->quan > 1L) ? destroy_strings[dindx*3 + 1] : destroy_strings[dindx*3]); delobj(obj); retval++; } else if (obj->oclass == POTION_CLASS) { dindx = 1; if (in_sight) - pline("%s %s.", Yname2(obj), (obj->quan > 1) ? + pline("%s %s.", Yname2(obj), (obj->quan > 1L) ? destroy_strings[dindx*3 + 1] : destroy_strings[dindx*3]); delobj(obj); retval++; diff --git a/src/uhitm.c b/src/uhitm.c index 40bafb65a..1933845cb 100644 --- a/src/uhitm.c +++ b/src/uhitm.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)uhitm.c 3.4 2004/11/11 */ +/* SCCS Id: @(#)uhitm.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -758,7 +758,7 @@ int thrown; You("hit %s with %s %s.", mon_nam(mon), obj->dknown ? the(mons[obj->corpsenm].mname) : an(mons[obj->corpsenm].mname), - (obj->quan > 1) ? makeplural(withwhat) : withwhat); + (obj->quan > 1L) ? makeplural(withwhat) : withwhat); if (!munstone(mon, TRUE)) minstapetrify(mon, TRUE); if (resists_ston(mon)) break; @@ -786,7 +786,7 @@ int thrown; hand-to-hand attack should yield a "bashing" mesg */ if (obj == uwep) unweapon = TRUE; if (obj->spe && obj->corpsenm >= LOW_PM) { - if (obj->quan < 5) + if (obj->quan < 5L) change_luck((schar) -(obj->quan)); else change_luck(-5); @@ -854,7 +854,7 @@ int thrown; } else { char *whom = mon_nam(mon); char *what = The(xname(obj)); - if (!thrown && obj->quan > 1) + if (!thrown && obj->quan > 1L) what = An(singular(obj, xname)); /* note: s_suffix returns a modifiable buffer */ if (haseyes(mdat) diff --git a/src/zap.c b/src/zap.c index 08599b17e..dfdfd593b 100644 --- a/src/zap.c +++ b/src/zap.c @@ -1,4 +1,4 @@ -/* SCCS Id: @(#)zap.c 3.4 2004/11/22 */ +/* SCCS Id: @(#)zap.c 3.4 2004/12/21 */ /* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */ /* NetHack may be freely redistributed. See license for details. */ @@ -3300,16 +3300,16 @@ boolean u_caused; obj_resists(obj, 2, 100)) continue; scrquan = obj->quan; /* number present */ - delquan = 0; /* number to destroy */ - for (i = scrquan; i > 0; i--) + delquan = 0L; /* number to destroy */ + for (i = scrquan; i > 0L; i--) if (!rn2(3)) delquan++; if (delquan) { /* save name before potential delobj() */ if (give_feedback) { - obj->quan = 1; + obj->quan = 1L; Strcpy(buf1, (x == u.ux && y == u.uy) ? xname(obj) : distant_name(obj, xname)); - obj->quan = 2; + obj->quan = 2L; Strcpy(buf2, (x == u.ux && y == u.uy) ? xname(obj) : distant_name(obj, xname)); obj->quan = scrquan; @@ -3320,7 +3320,7 @@ boolean u_caused; else delobj(obj); cnt += delquan; if (give_feedback) { - if (delquan > 1) + if (delquan > 1L) pline("%ld %s burn.", delquan, buf2); else pline("%s burns.", An(buf1)); @@ -3963,7 +3963,7 @@ register int osym, dmgtyp; physical_damage = FALSE; if(obj->oclass != osym) continue; /* test only objs of type osym */ if(obj->oartifact) continue; /* don't destroy artifacts */ - if(obj->in_use && obj->quan == 1) continue; /* not available */ + if(obj->in_use && obj->quan == 1L) continue; /* not available */ xresist = skip = 0; #ifdef GCC_WARN dmg = dindx = 0;