Fix shop steal when teleporting your swallower

Picking up a shop item and not paying it, getting swallowed
by a monster, and then teleporting the monster out of the shop
with you in it, the shopkeeper didn't notice the theft.
But the object was not marked as paid either.

Also prevent giving a message of the swallower disappearing
and appearing when it was teleported.  (Although now there's
no message given, so something should be added ...)
This commit is contained in:
Pasi Kallinen
2025-01-03 17:34:24 +02:00
parent bf3654dbe2
commit ba731a346b

View File

@@ -1643,6 +1643,7 @@ rloc_to_core(
if (u.ustuck == mtmp) {
if (u.uswallow) {
u_on_newpos(mtmp->mx, mtmp->my);
check_special_room(FALSE);
docrt();
} else if (!m_next2u(mtmp)) {
unstuck(mtmp);
@@ -1652,7 +1653,7 @@ rloc_to_core(
maybe_unhide_at(x, y);
newsym(x, y); /* update new location */
set_apparxy(mtmp); /* orient monster */
if (domsg && (canspotmon(mtmp) || appearmsg)) {
if (domsg && (canspotmon(mtmp) || appearmsg) && (u.ustuck != mtmp)) {
int du = distu(x, y), olddu;
const char *next = (du <= 2) ? " next to you" : 0, /* next2u() */
*nearu = (du <= BOLT_LIM * BOLT_LIM) ? " close by" : 0;