diff --git a/include/flag.h b/include/flag.h index fe5b78ab0..1b73cb0e6 100644 --- a/include/flag.h +++ b/include/flag.h @@ -196,6 +196,7 @@ struct instance_flags { boolean lua_testing; /* doing lua tests */ boolean partly_eaten_hack; /* extra flag for xname() used when it's called * indirectly so we can't use xname_flags() */ + boolean remember_getpos; /* save getpos() positioning in do-again queue */ boolean sad_feeling; /* unseen pet is dying */ int at_midnight; /* only valid during end of game disclosure */ int at_night; /* also only valid during end of game disclosure */ diff --git a/src/do_name.c b/src/do_name.c index 0c6c24cca..cee5c2efe 100644 --- a/src/do_name.c +++ b/src/do_name.c @@ -775,7 +775,10 @@ getpos(coord *ccp, boolean force, const char *goal) free(cmdq); } else { c = readchar_poskey(&tx, &ty, &sidx); - if (!g.in_doagain) + /* remember_getpos is normally False because reusing the + current positioning during ^A is almost never the right + thing to do, but caller could set it if that was needed */ + if (iflags.remember_getpos && !g.in_doagain) cmdq_add_key(CQ_REPEAT, c); }