]> granicus.if.org Git - nethack/commitdiff
potion-from-sink and the corpsenm field
authorcohrs <cohrs>
Tue, 30 Sep 2003 18:55:02 +0000 (18:55 +0000)
committercohrs <cohrs>
Tue, 30 Sep 2003 18:55:02 +0000 (18:55 +0000)
Change the code involved to use a new #define for the field, like other
overloaded uses of corpsenm.  Also remove one check for this field from
potion.c: there are no blessed potions from sinks.

doc/fixes34.3
include/obj.h
src/do_name.c
src/fountain.c
src/potion.c

index 926f43286a036ed7bc5981cf7c91d88b6aaed442..f51254781f4902a5037ffdb26638848c1914adb6 100644 (file)
@@ -37,6 +37,7 @@ if the monster that a statue represents is not made of flesh then don't
        allow stone_to_flesh to animate it, make a meatball instead
 attempting to saddle a cockatrice while wearing gloves shouldn't stone you
 kicking a closed drawbridge and dieing should not say "kicking a wall"
+cannot get blessed potions from sink, remove unreachable message
 
 
 Platform- and/or Interface-Specific Fixes
index 265a6aafb8645483f0001c458ede1c6663e6cefb..bc4e6367561cc0a4b58581303e2617a839223e78 100644 (file)
@@ -96,7 +96,8 @@ struct obj {
 
        int     corpsenm;       /* type of corpse is mons[corpsenm] */
 #define leashmon  corpsenm     /* gets m_id of attached pet */
-#define spestudied corpsenm    /* how many times a spellbook has been studied */
+#define spestudied corpsenm    /* # of times a spellbook has been studied */
+#define fromsink  corpsenm     /* a potion from a sink */
        unsigned oeaten;        /* nutrition left in food, if partly eaten */
        long age;               /* creation date */
 
index 7c7ed5c25bbeb7cea217470c08d73a1673b87f47..9d3cff73ef5a64bdfda4a83d42bf617973ef3b6c 100644 (file)
@@ -497,7 +497,7 @@ register struct obj *obj;
        otemp.quan = 1L;
        otemp.onamelth = 0;
        otemp.oxlth = 0;
-       if (objects[otemp.otyp].oc_class == POTION_CLASS && otemp.corpsenm)
+       if (objects[otemp.otyp].oc_class == POTION_CLASS && otemp.fromsink)
            /* kludge, meaning it's sink water */
            Sprintf(qbuf,"Call a stream of %s fluid:",
                    OBJ_DESCR(objects[otemp.otyp]));
index 1785500b09ff69ea6a7e90847e0efb84f4c14b9b..acbaac2d129d2277b246ff8ad547f4687430cfbf 100644 (file)
@@ -549,7 +549,7 @@ drinksink()
                              hcolor(OBJ_DESCR(objects[otmp->otyp])));
                        otmp->dknown = !(Blind || Hallucination);
                        otmp->quan++; /* Avoid panic upon useup() */
-                       otmp->corpsenm = 1; /* kludge for docall() */
+                       otmp->fromsink = 1; /* kludge for docall() */
                        (void) dopotion(otmp);
                        obfree(otmp, (struct obj *)0);
                        break;
index da8f00d0ca037b706b2949d83e6e4da349864f4f..0207211173fd7c6763abda1bf687e6fa551a8111 100644 (file)
@@ -666,12 +666,8 @@ peffects(otmp)
                    pline("(But in fact it was mildly stale %s.)",
                          fruitname(TRUE));
                    if (!Role_if(PM_HEALER)) {
-                       if (otmp->corpsenm)
-                           losehp(1,
-                                  "mildly contaminated tap water", KILLED_BY);
-                       else
-                           losehp(1,
-                                  "mildly contaminated potion", KILLED_BY_AN);
+                       /* NB: blessed otmp->fromsink is not possible */
+                       losehp(1, "mildly contaminated potion", KILLED_BY_AN);
                    }
                } else {
                    if(Poison_resistance)
@@ -690,7 +686,7 @@ peffects(otmp)
                                        TRUE);
                        }
                        if(!Poison_resistance) {
-                           if (otmp->corpsenm)
+                           if (otmp->fromsink)
                                losehp(rnd(10)+5*!!(otmp->cursed),
                                       "contaminated tap water", KILLED_BY);
                            else