From 04174eda2a34d9be8f76b63f82ce30fc5ba066ca Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Fri, 24 Oct 2003 11:52:49 +0000 Subject: [PATCH] starting pet identification Make it possible to identify your starting pet throughout the game via is_starting_pet(mon) macro. --- include/context.h | 1 + include/monst.h | 1 + include/patchlevel.h | 2 +- src/dog.c | 1 + 4 files changed, 4 insertions(+), 1 deletion(-) diff --git a/include/context.h b/include/context.h index 3cf517002..7bd39978f 100644 --- a/include/context.h +++ b/include/context.h @@ -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; diff --git a/include/monst.h b/include/monst.h index 335b6150a..9996ffcb3 100644 --- a/include/monst.h +++ b/include/monst.h @@ -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 */ diff --git a/include/patchlevel.h b/include/patchlevel.h index a73f62c17..f94f824a1 100644 --- a/include/patchlevel.h +++ b/include/patchlevel.h @@ -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" diff --git a/src/dog.c b/src/dog.c index 476404836..2104292f6 100644 --- 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))) { -- 2.50.1