fix #H7173 / github #101 - vault exit

Fixes #101

If you tell the vault guard your name, drop carried gold, wait one
turn, then pick up the gold again, the guard will move a step away
during the wait.  If you teleport away, the guard will seal vault
walls and then park himself on the one-square (so far) temporary
corridor adjacent to the vault wall.  Periodically he'll say "Move
along!" and the hero will hear it, regardless of location on the
level.  Unless you dig a corridor to rescue him, or one or more of
the vault's walls get breached again, he will never move.

The report emphasized that you could use this to steal the vault's
gold, but it relies on being able to teleport beyond the gaurd's
reach and if you can do that, you might as well do so before the
guard comes.  The stranded guard, and him saying "Move along!" when
no longer leading hero out of the vault, are more significant bugs.

Bonus fix:  if the game ends and the guard seals up the vault while
the hero is in a spot that gets fixed up (vault wall or temporary
corridor) don't give the "You are encased in the rock" message if
game end was due to death rather than quit.
This commit is contained in:
PatR
2019-02-02 17:37:06 -08:00
parent b43b3f617c
commit 7cc718ea0e
5 changed files with 62 additions and 11 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 hack.c $NHDT-Date: 1546656413 2019/01/05 02:46:53 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.203 $ */
/* NetHack 3.6 hack.c $NHDT-Date: 1549157812 2019/02/03 01:36:52 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.206 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Derek S. Ray, 2015. */
/* NetHack may be freely redistributed. See license for details. */
@@ -2269,9 +2269,9 @@ register int typewanted;
int typefound, min_x, min_y, max_x, max_y_offset, step;
register struct rm *lev;
#define goodtype(rno) \
(!typewanted \
|| (typefound = rooms[rno - ROOMOFFSET].rtype) == typewanted \
#define goodtype(rno) \
(!typewanted \
|| (typefound = (rooms[rno - ROOMOFFSET].rtype == typewanted)) != 0 \
|| (typewanted == SHOPBASE && typefound > SHOPBASE))
switch (rno = levl[x][y].roomno) {