]> granicus.if.org Git - nethack/commitdiff
another lint bit
authornethack.rankin <nethack.rankin>
Fri, 10 Jan 2003 03:44:09 +0000 (03:44 +0000)
committernethack.rankin <nethack.rankin>
Fri, 10 Jan 2003 03:44:09 +0000 (03:44 +0000)
     The heros_fault() macro added to region.h relatively recently causes
a K&R vintage compiler to choke on the heros_fault variable in dothrow.c.
Although the latter has been around longer, changing it was a little bit
simpler.

src/dothrow.c

index 28a61d90abfb24b769c6223be1b00bcb6465af33..8eeea3dfb6c705c4aae18c84a99da4f524bf6890 100644 (file)
@@ -1483,19 +1483,17 @@ xchar x, y;             /* object location (ox, oy may not be right) */
 /*
  * Unconditionally break an object. Assumes all resistance checks
  * and break messages have been delivered prior to getting here.
- * This routine assumes the cause is the hero if heros_fault is TRUE.
- *
  */
 STATIC_OVL void
-breakobj(obj, x, y, heros_fault, from_invent)
+breakobj(obj, x, y, hero_caused, from_invent)
 struct obj *obj;
 xchar x, y;            /* object location (ox, oy may not be right) */
-boolean heros_fault;
+boolean hero_caused;   /* is this the hero's fault? */
 boolean from_invent;
 {
        switch (obj->oclass == POTION_CLASS ? POT_WATER : obj->otyp) {
                case MIRROR:
-                       if (heros_fault)
+                       if (hero_caused)
                            change_luck(-2);
                        break;
                case POT_WATER:         /* really, all potions */
@@ -1522,11 +1520,11 @@ boolean from_invent;
                        break;
                case EGG:
                        /* breaking your own eggs is bad luck */
-                       if (heros_fault && obj->spe && obj->corpsenm >= LOW_PM)
+                       if (hero_caused && obj->spe && obj->corpsenm >= LOW_PM)
                            change_luck((schar) -min(obj->quan, 5L));
                        break;
        }
-       if (heros_fault) {
+       if (hero_caused) {
            if (from_invent) {
                if (*u.ushops)
                        check_shop_obj(obj, x, y, TRUE);