]> granicus.if.org Git - nethack/commitdiff
R804 - fix crash caused by looking at a unique boulder symbol
authorcohrs <cohrs>
Fri, 19 Apr 2002 02:28:20 +0000 (02:28 +0000)
committercohrs <cohrs>
Fri, 19 Apr 2002 02:28:20 +0000 (02:28 +0000)
The code only handled the case where the boulder symbol was non-unique.
Add code to handle the case where the boulder sym is the first match.

doc/fixes34.1
src/pager.c

index bfe1c411816f9d2e2c3fa24bb517ea5bc4a72aa8..ad5647b65f439bd8902b8edd0094c79a01af033d 100644 (file)
@@ -83,6 +83,7 @@ axes should chop trees; picks shouldn't
 chance to aim grappling hook when skilled or better
 level limit of monsters like naga hatchlings should be high enough to grow up
 scroll of enchant weapon will become discovered when read in some cases
+don't crash when using lookat on a boulder an BOULDER sym is unique
 
 
 Platform- and/or Interface-Specific Fixes
index 4eb86a26f59b9568d50794baee0b11f8ff24b61a..010788355f821637c893b908e30d340ed00d89d7 100644 (file)
@@ -656,8 +656,15 @@ do_look(quick)
        }
 
        /* handle optional boulder symbol as a special case */ 
-       if (iflags.bouldersym && sym == iflags.bouldersym)
+       if (iflags.bouldersym && sym == iflags.bouldersym) {
+           if (!found) {
+               firstmatch = "boulder";
+               Sprintf(out_str, "%c       %s", sym, an(firstmatch));
+               found++;
+           } else {
                found += append_str(out_str, "boulder");
+           }
+       }
        
        /*
         * If we are looking at the screen, follow multiple possibilities or