cloning minions
Janet pointed this one out to me...
This commit is contained in:
+17
-7
@@ -725,14 +725,24 @@ struct monst *mon;
|
|||||||
if (mon->mtame) {
|
if (mon->mtame) {
|
||||||
struct monst *m3;
|
struct monst *m3;
|
||||||
|
|
||||||
/* because m2 is a copy of mon it is tame but not init'ed.
|
if (mon->isminion) {
|
||||||
* however, tamedog will not re-tame a tame dog, so m2
|
m3 = newmonst(sizeof(struct epri) + mon->mnamelth);
|
||||||
* must be made non-tame to get initialized properly.
|
*m3 = *m2;
|
||||||
*/
|
m3->mxlth = sizeof(struct epri);
|
||||||
m2->mtame = 0;
|
if (m2->mnamelth) Strcpy(NAME(m3), NAME(m2));
|
||||||
if ((m3 = tamedog(m2, (struct obj *)0)) != 0) {
|
*(EPRI(m3)) = *(EPRI(mon));
|
||||||
|
replmon(m2, m3);
|
||||||
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;
|
return m2;
|
||||||
|
|||||||
+5
-2
@@ -286,8 +286,11 @@ register struct monst *mtmp;
|
|||||||
if (mtmp->mtame) { Strcat(info, ", tame");
|
if (mtmp->mtame) { Strcat(info, ", tame");
|
||||||
#ifdef WIZARD
|
#ifdef WIZARD
|
||||||
if (wizard) {
|
if (wizard) {
|
||||||
Sprintf(eos(info), " (%d; hungry %ld; apport %d)",
|
Sprintf(eos(info), " (%d", mtmp->mtame);
|
||||||
mtmp->mtame, EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
|
if (!mtmp->isminion)
|
||||||
|
Sprintf(eos(info), "; hungry %ld; apport %d",
|
||||||
|
EDOG(mtmp)->hungrytime, EDOG(mtmp)->apport);
|
||||||
|
Strcat(info, ")");
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user