Does magic whistling a pet out of a trap count as untrapping

nethack

More curiosity than strategy. I know untrapping a pet gives an alignment boost if you #untrap. But, does using a magic whistle give the same alignment boost?

Best Answer

No. Using a magic whistle simply removes a pet from a trap, without any of the additional effects that untrapping has. From the source code, use_magic_whistle() in apply.c:

if (mtmp->mtame) {
    if (mtmp->mtrapped) {
        /* no longer in previous trap (affects mintrap) */
        mtmp->mtrapped = 0;
        fill_pit(mtmp->mx, mtmp->my);
    }

(fill_pit() deals with the possibility that teleporting your pet resulted in a boulder being left on top of a pit trap.)