From af51f4b0a2238eb029ee71a27b9cc3fa11785cb3 Mon Sep 17 00:00:00 2001 From: arromdee Date: Tue, 26 Feb 2002 06:55:17 +0000 Subject: [PATCH] cloning Fix a minor cloning problem; clones didn't retain the monster's name or tameness. (The name *was* retained if you were cloned.) I also added a minor change in wizard mode to display a few tameness fields of a dog. --- doc/fixes34.0 | 1 + src/makemon.c | 9 +++++++-- src/pline.c | 8 +++++++- 3 files changed, 15 insertions(+), 3 deletions(-) diff --git a/doc/fixes34.0 b/doc/fixes34.0 index 8601a415e..374ab284c 100644 --- a/doc/fixes34.0 +++ b/doc/fixes34.0 @@ -445,6 +445,7 @@ No "corridor disappears" message if Vault guard dies off-level slip while mounting and levitating at will should not cause damage if you see a monster jump into a trap in a secret corridor, it's not secret fixed a few places where unblock_point wasn't called but should have been +cloned monsters should have the same name and tameness as the original Platform- and/or Interface-Specific Fixes diff --git a/src/makemon.c b/src/makemon.c index 21012ec4b..b579b1151 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -713,11 +713,14 @@ struct monst *mon; if (mon->isgd) m2->isgd = FALSE; if (mon->ispriest) m2->ispriest = FALSE; m2->mxlth = 0; - m2->mnamelth = 0; place_monster(m2, m2->mx, m2->my); if (emits_light(m2->data)) new_light_source(m2->mx, m2->my, emits_light(m2->data), LS_MONSTER, (genericptr_t)m2); + if (m2->mnamelth) { + m2->mnamelth = 0; /* or it won't get allocated */ + m2 = christen_monst(m2, NAME(mon)); + } newsym(m2->mx,m2->my); /* display the new monster */ if (mon->mtame) { struct monst *m3; @@ -727,8 +730,10 @@ struct monst *mon; * must be made non-tame to get initialized properly. */ m2->mtame = 0; - if ((m3 = tamedog(m2, (struct obj *)0)) != 0) + if ((m3 = tamedog(m2, (struct obj *)0)) != 0) { m2 = m3; + *(EDOG(m2)) = *(EDOG(mon)); + } } return m2; } diff --git a/src/pline.c b/src/pline.c index b4d7af244..fc953d0aa 100644 --- a/src/pline.c +++ b/src/pline.c @@ -5,6 +5,9 @@ #define NEED_VARARGS /* Uses ... */ /* comment line for pre-compiled headers */ #include "hack.h" #include "epri.h" +#ifdef WIZARD +#include "edog.h" +#endif #ifdef OVLB @@ -282,7 +285,10 @@ register struct monst *mtmp; info[0] = 0; if (mtmp->mtame) { Strcat(info, ", tame"); #ifdef WIZARD - if (wizard) Sprintf(eos(info), " (%d)", mtmp->mtame); + if (wizard) { + Sprintf(eos(info), " (%d; hungry %ld; apport %d)", + mtmp->mtame, EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport); + } #endif } else if (mtmp->mpeaceful) Strcat(info, ", peaceful");