From: arromdee Date: Sat, 2 Feb 2002 07:18:52 +0000 (+0000) Subject: blessed +2 fireproof speed boots X-Git-Tag: MOVE2GIT~3289 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c06397a703b043d1ab4c0d24eca62df710961321;p=nethack blessed +2 fireproof speed boots The inability to wish for a blessed +2 fireproof speed boots really was a bug. Prefixes are checked for inside a loop which should allow them to be in any order; for some reason +nnn and empty were outside that loop. Also adding the secret door detection fix to betabugs 3.3.0. (Is it safe to hand-modify betabugs 3.3.2?) --- diff --git a/doc/fixes33.2 b/doc/fixes33.2 index 033c0d98c..ed7731c6a 100644 --- a/doc/fixes33.2 +++ b/doc/fixes33.2 @@ -416,6 +416,7 @@ consider vortexes to be nonliving dragons have scales, not fur if player teleports a monster while swallowed on a noteleport level, the player should not teleport along with the monster +prefixes that can appear in any order when wishing should include +/- and empty Platform- and/or Interface-Specific Fixes diff --git a/src/objnam.c b/src/objnam.c index 0ad9650c8..68486d2e2 100644 --- a/src/objnam.c +++ b/src/objnam.c @@ -1557,6 +1557,12 @@ struct obj *no_wish; while(digit(*bp)) bp++; while(*bp == ' ') bp++; l = 0; + } else if (*bp == '+' || *bp == '-') { + spesgn = (*bp++ == '+') ? 1 : -1; + spe = atoi(bp); + while(digit(*bp)) bp++; + while(*bp == ' ') bp++; + l = 0; } else if (!strncmpi(bp, "blessed ", l=8) || !strncmpi(bp, "holy ", l=5)) { blessed = 1; @@ -1616,21 +1622,14 @@ struct obj *no_wish; ishistoric = 1; } else if (!strncmpi(bp, "diluted ", l=8)) { isdiluted = 1; + } else if(!strncmpi(bp, "empty ", l=6)) { + contents = EMPTY; } else break; bp += l; } if(!cnt) cnt = 1; /* %% what with "gems" etc. ? */ - if(!strncmpi(bp, "empty ", 6)) { - contents = EMPTY; - bp += 6; - } if (strlen(bp) > 1) { - if (*bp == '+' || *bp == '-') { - spesgn = (*bp++ == '+') ? 1 : -1; - spe = atoi(bp); - while(digit(*bp)) bp++; - while(*bp == ' ') bp++; - } else if ((p = rindex(bp, '(')) != 0) { + if ((p = rindex(bp, '(')) != 0) { if (p > bp && p[-1] == ' ') p[-1] = 0; else *p = 0; p++;