]> granicus.if.org Git - nethack/commitdiff
cloning minions
authorarromdee <arromdee>
Wed, 27 Feb 2002 02:17:01 +0000 (02:17 +0000)
committerarromdee <arromdee>
Wed, 27 Feb 2002 02:17:01 +0000 (02:17 +0000)
Janet pointed this one out to me...

src/makemon.c
src/pline.c

index b579b1151e58c07c3ef824716532df898b69cf85..1f43fee03428410ce31d17ba19f07998f4e41c1d 100644 (file)
@@ -725,14 +725,24 @@ struct monst *mon;
        if (mon->mtame) {
            struct monst *m3;
 
-           /* because m2 is a copy of mon it is tame but not init'ed.
-            * however, tamedog will not re-tame a tame dog, so m2
-            * must be made non-tame to get initialized properly.
-            */
-           m2->mtame = 0;
-           if ((m3 = tamedog(m2, (struct obj *)0)) != 0) {
+           if (mon->isminion) {
+               m3 = newmonst(sizeof(struct epri) + mon->mnamelth);
+               *m3 = *m2;
+               m3->mxlth = sizeof(struct epri);
+               if (m2->mnamelth) Strcpy(NAME(m3), NAME(m2));
+               *(EPRI(m3)) = *(EPRI(mon));
+               replmon(m2, m3);
                m2 = m3;
-               *(EDOG(m2)) = *(EDOG(mon));
+           } else {
+               /* because m2 is a copy of mon it is tame but not init'ed.
+                * however, tamedog will not re-tame a tame dog, so m2
+                * must be made non-tame to get initialized properly.
+                */
+               m2->mtame = 0;
+               if ((m3 = tamedog(m2, (struct obj *)0)) != 0) {
+                   m2 = m3;
+                   *(EDOG(m2)) = *(EDOG(mon));
+               }
            }
        }
        return m2;
index fc953d0aae9c8e4588193bc4e65d47e032f66647..08a6d1958da04d00fb8e44f2d7b6da4da23fe1cf 100644 (file)
@@ -286,8 +286,11 @@ register struct monst *mtmp;
        if (mtmp->mtame) {        Strcat(info, ", tame");
 #ifdef WIZARD
            if (wizard) {
-               Sprintf(eos(info), " (%d; hungry %ld; apport %d)",
-                   mtmp->mtame, EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
+               Sprintf(eos(info), " (%d", mtmp->mtame);
+               if (!mtmp->isminion)
+                   Sprintf(eos(info), "; hungry %ld; apport %d",
+                       EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
+               Strcat(info, ")");
            }
 #endif
        }