]> granicus.if.org Git - nethack/commit
fix #H2636 - vault guard "fakecorr overflow" panic
authorPatR <rankin@nethack.org>
Wed, 19 Dec 2018 11:06:40 +0000 (03:06 -0800)
committerPatR <rankin@nethack.org>
Wed, 19 Dec 2018 11:06:40 +0000 (03:06 -0800)
commitb32c93cacdc68997882f295bbf5ea2c5a9a7faec
tree6555a0a87616805cbd4d528b5a9573bf6c0ff67f
parent81d73ce417dda6a98e2e918e06922e68b67c53f7
fix #H2636 - vault guard "fakecorr overflow" panic

Another 6.5 year old report.  This one from Steven Melenchuk told
how to reproduce C343-23 which is still open on our 'known bugs'
page.  (I've no idea whether the original bug report came through
the contact page, and if so, what its assigned number was.)

I didn't try to solve this one, I just confirmed that it could be
reproduced and took the fix from grunthack at github.  He didn't
menion a fix at the time but implemented one before abandoing his
variant.  (Others kept it going afterwards; fix was during his time.)

The overflow occurred when the guard couldn't figure out where to
move to next and just repeatedly 'moved' to his current location
until the maximum number of fake corridor spots was used up.  The
fix detects not knowing where to go next and explicitly choosing a
new destination.

Original problem could be reproduced by teleporting into the vault,
digging out a wall and two spaces of stone in a straight line, then
going back into the vault to wait for a guard.  When he shows up:
answer, drop gold, follow.  If the guard's path walks through both
dug spaces, he will stop waiting for the hero.  But hero is in
between the guard and the gap in the vault wall and can't advance;
guard has reached a persistent corridor so doesn't know where to go
next.  Have hero wait for 125-ish more turns and then game panicks.

The code was 3.4.3 vintage so needed thorough reformatting, but not
any actual changes (unless I've overlooked something).
doc/fixes36.2
src/vault.c