From: nethack.allison Date: Fri, 24 Oct 2003 11:52:49 +0000 (+0000) Subject: starting pet identification X-Git-Tag: MOVE2GIT~1643 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=04174eda2a34d9be8f76b63f82ce30fc5ba066ca;p=nethack starting pet identification Make it possible to identify your starting pet throughout the game via is_starting_pet(mon) macro. --- 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))) {