]> granicus.if.org Git - nethack/commitdiff
change is_safepet macro name
authornhmall <nhmall@nethack.org>
Mon, 4 May 2020 01:52:41 +0000 (21:52 -0400)
committernhmall <nhmall@nethack.org>
Mon, 4 May 2020 01:52:41 +0000 (21:52 -0400)
Leaving the word "pet" in the macro name, when it applied to non-pets
seemed too contradictory, even for NetHack.

include/display.h
src/hack.c
src/uhitm.c

index 2c4a1104c6718bf380b1c1e242d7f3675322313d..7813c008a94a0ca8f0a64c4d00681b8be8f80547 100644 (file)
@@ -134,12 +134,12 @@ enum explosion_types {
              && distu(mon->mx, mon->my) <= (BOLT_LIM * BOLT_LIM))))
 
 /*
- * is_safepet(mon)
+ * is_safemon(mon)
  *
  * A special case check used in attack() and domove().  Placing the
  * definition here is convenient.  No longer limited to pets.
  */
-#define is_safepet(mon) \
+#define is_safemon(mon) \
     (flags.safe_dog && (mon) && (mon)->mpeaceful && canspotmon(mon)     \
      && !Confusion && !Hallucination && !Stunned)
 
index 85370b8582b13e3a65b983e5bc8436a04fe68874..81ed3c38e1214d4c63ce359bdb12921dcfe1cf1a 100644 (file)
@@ -1584,7 +1584,7 @@ domove_core()
         }
 
         mtmp = m_at(x, y);
-        if (mtmp && !is_safepet(mtmp)) {
+        if (mtmp && !is_safemon(mtmp)) {
             /* Don't attack if you're running, and can see it */
             /* It's fine to displace pets, though */
             /* We should never get here if forcefight */
@@ -1611,7 +1611,7 @@ domove_core()
         /* don't stop travel when displacing pets; if the
            displace fails for some reason, attack() in uhitm.c
            will stop travel rather than domove */
-        if (!is_safepet(mtmp) || g.context.forcefight)
+        if (!is_safemon(mtmp) || g.context.forcefight)
             nomul(0);
         /* only attack if we know it's there */
         /* or if we used the 'F' command to fight blindly */
@@ -1642,7 +1642,7 @@ domove_core()
         }
         if (g.context.forcefight || !mtmp->mundetected || sensemon(mtmp)
             || ((hides_under(mtmp->data) || mtmp->data->mlet == S_EEL)
-                && !is_safepet(mtmp))) {
+                && !is_safemon(mtmp))) {
 
             /* target monster might decide to switch places with you... */
             if (mtmp->data == &mons[PM_DISPLACER_BEAST] && !rn2(2)
@@ -1830,7 +1830,7 @@ domove_core()
      * Ceiling-hiding pets are skipped by this section of code, to
      * be caught by the normal falling-monster code.
      */
-    } else if (is_safepet(mtmp)
+    } else if (is_safemon(mtmp)
                && !(is_hider(mtmp->data) && mtmp->mundetected)) {
         /* if it turns out we can't actually move */
         boolean didnt_move = FALSE;
index 52df4721c97ec9765aef2305055e1c96ad5c85c7..0b9b22c47ee399c1caa18b11883d17a66162e5f2 100644 (file)
@@ -336,7 +336,7 @@ register struct monst *mtmp;
      * you'll usually just swap places if this is a movement command
      */
     /* Intelligent chaotic weapons (Stormbringer) want blood */
-    if (is_safepet(mtmp) && !g.context.forcefight) {
+    if (is_safemon(mtmp) && !g.context.forcefight) {
         if (!uwep || uwep->oartifact != ART_STORMBRINGER) {
             /* There are some additional considerations: this won't work
              * if in a shop or Punished or you miss a random roll or