* previous location using the same conditions as in attack().
* there are special extenuating circumstances:
* (1) if the pet dies then your god angers,
- * (2) if the pet gets trapped then your god may disapprove,
- * (3) if the pet was already trapped and you attempt to free it
- * not only do you encounter the trap but you may frighten your
- * pet causing it to go wild! moral: don't abuse this privilege.
+ * (2) if the pet gets trapped then your god may disapprove.
*
* Ceiling-hiding pets are skipped by this section of code, to
* be caught by the normal falling-monster code.
/* can't swap places when pet won't fit thru the opening */
You("stop. %s won't fit through.", upstart(y_monnam(mtmp)));
didnt_move = TRUE;
- } else if (mtmp->mpeaceful && !mtmp->mtame && mtmp->mtrapped) {
- /* TODO: pets can get angered when displaced out of a trap.
- * Having peaceful monsters simply refuse is inconsistent.
- * Probably, pets should not be able to be displaced out of a
- * trap like a pit or bear trap at all. */
+ } else if ((mtmp->mpeaceful || mtmp->mtame) && mtmp->mtrapped) {
+ /* Since peaceful monsters simply being unable to move out of traps
+ * was inconsistent with pets being able to but being untamed in the
+ * process, apply this logic equally to pets and peacefuls. */
You("stop. %s can't move out of that trap.",
upstart(y_monnam(mtmp)));
didnt_move = TRUE;
- } else if (mtmp->mpeaceful && !mtmp->mtame
+ } else if (mtmp->mpeaceful
&& (!goodpos(u.ux0, u.uy0, mtmp, 0)
|| t_at(u.ux0, u.uy0) != NULL
|| mtmp->ispriest
upstart(y_monnam(mtmp)));
didnt_move = TRUE;
} else {
- /* if trapped, there's a chance the pet goes wild */
- if (mtmp->mtrapped) {
- if (!rn2(mtmp->mtame)) {
- mtmp->mtame = mtmp->mpeaceful = mtmp->msleeping = 0;
- if (mtmp->mleashed)
- m_unleash(mtmp, TRUE);
- growl(mtmp);
- } else {
- yelp(mtmp);
- }
- }
char pnambuf[BUFSZ];
/* save its current description in case of polymorph */