]> granicus.if.org Git - nethack/commitdiff
starting pet identification
authornethack.allison <nethack.allison>
Fri, 24 Oct 2003 11:52:49 +0000 (11:52 +0000)
committernethack.allison <nethack.allison>
Fri, 24 Oct 2003 11:52:49 +0000 (11:52 +0000)
Make it possible to identify your starting pet throughout the game
via is_starting_pet(mon) macro.

include/context.h
include/monst.h
include/patchlevel.h
src/dog.c

index 3cf517002955640fcbe2b350d80d5105c93a2420..7bd39978f4cd34e08e5823adfbece5069c33e37d 100644 (file)
@@ -72,6 +72,7 @@ struct context_info {
        unsigned run;           /* 0: h (etc), 1: H (etc), 2: fh (etc) */
                                /* 3: FH, 4: ff+, 5: ff-, 6: FF+, 7: FF- */
                                /* 8: travel */
+       unsigned startingpet_mid;
        int      warnlevel;
        int      djinni_count, ghost_count;     /* potion effect tuning */
        long stethoscope_move;
index 335b6150a764669c8247e2970bd03fc0e485e1a1..9996ffcb3f44b1c013056bd7ef63e2520c543234 100644 (file)
@@ -178,5 +178,6 @@ struct monst {
 #define MON_NOWEP(mon) ((mon)->mw = (struct obj *)0)
 
 #define DEADMONSTER(mon)       ((mon)->mhp < 1)
+#define is_starting_pet(mon)   ((mon)->m_id == context.startingpet_mid)
 
 #endif /* MONST_H */
index a73f62c17a51a9a292f1b3690783b49cbeedbc9b..f94f824a1cc7ef913e1338b02e35c4cdc3f7f78f 100644 (file)
@@ -13,7 +13,7 @@
  * Incrementing EDITLEVEL can be used to force invalidation of old bones
  * and save files.
  */
-#define EDITLEVEL      5
+#define EDITLEVEL      6
 
 #define COPYRIGHT_BANNER_A \
 "NetHack, Copyright 1985-2003"
index 476404836dfbe4feb7c751258dfcd2c6b2f984f9..2104292f63f53c3492d112dabd9b003e266f9f89 100644 (file)
--- a/src/dog.c
+++ b/src/dog.c
@@ -156,6 +156,7 @@ makedog()
 
        if(!mtmp) return((struct monst *) 0); /* pets were genocided */
 
+       context.startingpet_mid = mtmp->m_id;
 #ifdef STEED
        /* Horses already wear a saddle */
        if (pettype == PM_PONY && !!(otmp = mksobj(SADDLE, TRUE, FALSE))) {