]> granicus.if.org Git - nethack/commitdiff
obj->quan bits
authornethack.allison <nethack.allison>
Tue, 21 Dec 2004 16:40:14 +0000 (16:40 +0000)
committernethack.allison <nethack.allison>
Tue, 21 Dec 2004 16:40:14 +0000 (16:40 +0000)
src/apply.c
src/dothrow.c
src/end.c
src/explode.c
src/mhitu.c
src/potion.c
src/shk.c
src/sit.c
src/trap.c
src/uhitm.c
src/zap.c

index b527b126abd03aeb2bd9ca91ec7798cfd6dfd2be..afa88aa921f21e873dec7f59e7d0912999d39db5 100644 (file)
@@ -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
index ef3495d668e3bfda86f5e295367a3f84172bd248..b085b7e8fd82f2d836c709e597379637604e11e7 100644 (file)
@@ -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:
index 2ffb78cb6c7afb65d6d0c9f98fee5419c8d3b4ee..22cb0a50647329c70278284a963c44ce2c32999f 100644 (file)
--- 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);
                    }
index 1ebf8715b7b84c2011d9188e808dc417b8ff78d2..72862d1b3d1bc120ed1dde702e894f1e887f3e48 100644 (file)
@@ -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);
index ecd9d7006c8f6e5086775b029273cfb5d1e12813..537a7fb20d3056426b72fb0e6fa6206584d66d06 100644 (file)
@@ -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));
 }
 
index cd77eca369f2b3178e61a11f151582e432641819..7af1c66e9304dc088854c1f8d7b718d7a0a34d69 100644 (file)
@@ -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) {
index 07eb9d7ab8fc7e00641e68134c1c6cd184060f20..66bd71cd740d7eeb45acfaca83d44722dec96a45 100644 (file)
--- 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);
            }
index 9846f4e50de55f1df5e89fbf7e78b4252a297788..625e58137385556f8d2385880352b18347879f35 100644 (file)
--- 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;
index 2ad66652d9daafada96320e24aaf860bee5104a7..bcc875ef67b6080ea96bc9dd26a58f183ef29ea6 100644 (file)
@@ -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++;
index 40bafb65a5bb9f396b8a6505892ff92bca82a094..1933845cb93761bd49c3e31e9dc823137389c01c 100644 (file)
@@ -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)
index 08599b17efb2007d28221d611fc5d31e1bd58a6a..dfdfd593b22fac790f6b833595b1e044e4642eb1 100644 (file)
--- 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;