From: PatR Date: Sat, 23 Apr 2022 21:52:36 +0000 (-0700) Subject: fix to #adjust for '!fixinv' config X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=6bc52ebb77ee8957091caf58e52aa8918dd261e1;p=nethack fix to #adjust for '!fixinv' config If you have 'fixinv' set to Off and and an inventory of three items, they'll always be a and b and c. #adjust had you pick 'from' slot among [abc] and the prompt for 'to' was supposed to show the letter you picked plus 'd' for 'move to last'. But it was only showing the 'from' letter itself as likely candidate, omitting the last+1 choice. (Anything after the last letter in use could be picked and yield the right result, only the list of likely candidate slots in the prompt wrong.) Fixed more by trial and error than by understanding why the old code didn't do what was intended. --- diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index c8b4afaa3..789e17de4 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -885,6 +885,10 @@ when drinking or dipping, allow the 'm' prefix to be used to skip asking calling real or fake Amulet something could give away information about them throwing gold while inside a purple worm would yield "The gold disappears in the the purple worm's entrails." (note doubled "the") +inventory #adjust for !fixinv, after picking 'from' slot the prompt for 'to' + slot was supposed to include the next letter beyond those in use as + a candidate for destination but an off by 1 error only showed a-x + where x is last letter used (despite that, y could still be picked) Fixes to 3.7.0-x Problems that Were Exposed Via git Repository diff --git a/src/invent.c b/src/invent.c index b83417eaf..43ea03fc2 100644 --- a/src/invent.c +++ b/src/invent.c @@ -4891,7 +4891,7 @@ doorganize_core(struct obj *obj) lets[sizeof lets - 1] = '\0'; /* for floating inv letters, truncate list after the first open slot */ if (!flags.invlet_constant && (ix = inv_cnt(FALSE)) < 52) - lets[ix + (splitting ? 0 : 1)] = '\0'; + lets[ix + (splitting ? 1 : 2)] = '\0'; /* blank out all the letters currently in use in the inventory except those that will be merged with the selected object */