]> granicus.if.org Git - nethack/commitdiff
B12010 - boulders in throw menu for giants
authorcohrs <cohrs>
Thu, 24 Oct 2002 01:40:58 +0000 (01:40 +0000)
committercohrs <cohrs>
Thu, 24 Oct 2002 01:40:58 +0000 (01:40 +0000)
When the player is poly'd to a giant, it was a bit odd that boulders
weren't listed in the throw menu, especially since the usual check for them
is throws_rocks.  Since statues are not appropriate, I added this thru yet
another ugly check in getobj.

src/invent.c

index 52aa17889ff04939097ef947c42d1a27426d6500..9d5d0a8beca07e8b2fa0e0f8c5b9259c2e903d95 100644 (file)
@@ -760,6 +760,7 @@ register const char *let,*word;
        boolean usegold = FALSE;        /* can't use gold because its illegal */
        boolean allowall = FALSE;
        boolean allownone = FALSE;
+       boolean useboulder = FALSE;
        xchar foox = 0;
        long cnt;
        boolean prezero = FALSE;
@@ -793,6 +794,11 @@ register const char *let,*word;
         */
        if(allowall && !strcmp(word, "read")) allowall = FALSE;
 
+       /* another ugly check: show boulders (not statues) */
+       if(*let == WEAPON_CLASS &&
+          !strcmp(word, "throw") && throws_rocks(youmonst.data))
+           useboulder = TRUE;
+
        if(allownone) *bp++ = '-';
 #ifndef GOLDOBJ
        if(allowgold) *bp++ = def_oc_syms[COIN_CLASS];
@@ -811,6 +817,7 @@ register const char *let,*word;
 #ifdef GOLDOBJ
                || (usegold && otmp->invlet == GOLD_SYM)
 #endif
+               || (useboulder && otmp->otyp == BOULDER)
                ) {
                register int otyp = otmp->otyp;
                bp[foo++] = otmp->invlet;