diff --git a/doc/fixes35.0 b/doc/fixes35.0 index 0fde5dc7f..33f4c8e87 100644 --- a/doc/fixes35.0 +++ b/doc/fixes35.0 @@ -153,6 +153,8 @@ don't discover unknown bag of tricks when monster it releases is undetected make region ttl field a long instead of short to get rid of lint warnings about a possible loss of data pushing a boulder onto a level teleporter trap could issue repeat messages +if shopkeeper or priest gets teleported while inside his shop or temple, + give locations inside that room preference when choosing destination Platform- and/or Interface-Specific Fixes diff --git a/src/teleport.c b/src/teleport.c index aa6b7edd8..7d3f58189 100644 --- a/src/teleport.c +++ b/src/teleport.c @@ -921,6 +921,14 @@ struct monst *mtmp; !within_bounded_area(x, y, dndest.nlx, dndest.nly, dndest.nhx, dndest.nhy))); } else { + /* [try to] prevent a shopkeeper or temple priest from being + sent out of his room (caller might resort to goodpos() if + we report failure here, so this isn't full prevention) */ + if (mtmp->isshk && inhishop(mtmp)) { + if (levl[x][y].roomno != ESHK(mtmp)->shoproom) return FALSE; + } else if (mtmp->ispriest && inhistemple(mtmp)) { + if (levl[x][y].roomno != EPRI(mtmp)->shroom) return FALSE; + } /* current location is */ if (!tele_jump_ok(xx, yy, x, y)) return FALSE; }