]> granicus.if.org Git - nethack/commitdiff
more recovered bits
authorPatR <rankin@nethack.org>
Sat, 26 Mar 2016 00:26:37 +0000 (17:26 -0700)
committerPatR <rankin@nethack.org>
Sat, 26 Mar 2016 00:26:37 +0000 (17:26 -0700)
Some worthwhile stuff from abandoned 'git stash':
 is_plural() macro wasn't comprehensive;
 a couple of return values where writing with a magic marker was
   causing time to elapse even though nothing happened;
 comment formatting for saddle being left in shop by dying steed.

include/obj.h
src/steal.c
src/write.c

index a511e1cf65fc2f3f98ff67e3d939d0cbb273153e..bb872af4f53f2ee68bac21e7e20b9817bc8c370c 100644 (file)
@@ -337,7 +337,7 @@ struct obj {
 
 /* helpers, simple enough to be macros */
 #define is_plural(o) \
-    ((o)->quan > 1 || (o)->oartifact == ART_EYES_OF_THE_OVERWORLD)
+    ((o)->quan != 1L || (o)->otyp == LENSES || is_gloves(o) || is_boots(o))
 
 /* Flags for get_obj_location(). */
 #define CONTAINED_TOO 0x1
index b3e5cb1f58c0b4e4f57201181c99cbf3167179fc..a973bf7a291890269428fe57a64375bcce9919bc 100644 (file)
@@ -646,10 +646,11 @@ boolean verbosely;
         if (mon->mhp > 0) {
             mon->misc_worn_check &= ~obj->owornmask;
             update_mon = TRUE;
-            /* don't charge for an owned saddle on dead steed (provided
-               that the hero is within the same shop at the time) */
-        } else if (mon->mtame && (obj->owornmask & W_SADDLE) && !obj->unpaid
-                   && costly_spot(omx, omy)
+
+        /* don't charge for an owned saddle on dead steed (provided
+           that the hero is within the same shop at the time) */
+        } else if (mon->mtame && (obj->owornmask & W_SADDLE) != 0L
+                   && !obj->unpaid && costly_spot(omx, omy)
                    /* being at costly_spot guarantees lev->roomno is not 0 */
                    && index(in_rooms(u.ux, u.uy, SHOPBASE),
                             levl[omx][omy].roomno)) {
index 14db75706d8bbb074ffee77543882a8c8c342b74..b73bfb10bc6ace2fad6d9559cd17b20eb467afdd 100644 (file)
@@ -128,12 +128,12 @@ register struct obj *pen;
     if (Blind) {
         if (!paper->dknown) {
             You("don't know if that %s is blank or not.", typeword);
-            return 1;
+            return 0;
         } else if (paper->oclass == SPBOOK_CLASS) {
             /* can't write a magic book while blind */
             pline("%s can't create braille text.",
                   upstart(ysimple_name(pen)));
-            return 1;
+            return 0;
         }
     }
     paper->dknown = 1;