]> granicus.if.org Git - nethack/commitdiff
looting containers and monsters
authorcohrs <cohrs>
Wed, 15 May 2002 05:10:06 +0000 (05:10 +0000)
committercohrs <cohrs>
Wed, 15 May 2002 05:10:06 +0000 (05:10 +0000)
There's a check in doloot that's supposed to disallow looting nearby
monsters if you loot a container at the current location.  But, it only
worked if you looted the last container.  Make the behavior consistent.

doc/fixes34.1
src/pickup.c

index c5f5882207a5ff2853af6cae981d75077680655b..fe8477c81723afe4583d364a2cb3e3bf8c2134fd 100644 (file)
@@ -102,6 +102,7 @@ disallow mounting a trapped steed to avoid inappropriate trap effects
 #chat with meditating monster will rouse it
 suppress redundant message when stoning effect transforms a golem
 clear worn bits of any object grabbed by shopkeeper to avoid extract_nobj panic
+looting any container on a location should suppress looting nearby monsters
 
 
 Platform- and/or Interface-Specific Fixes
index 27fff2d976f6437a89989f98dd0d0f7922f3b754..b62d1c85d7d3e9ce3459628e9d018d8a31786c4c 100644 (file)
@@ -1429,6 +1429,8 @@ doloot()  /* loot a container on the floor. */
 lootcont:
 
     if (container_at(x, y, FALSE)) {
+       boolean any = FALSE;
+
        if (!able_to_loot(x, y)) return 0;
        for (cobj = level.objects[x][y]; cobj; cobj = nobj) {
            nobj = cobj->nexthere;
@@ -1438,6 +1440,7 @@ lootcont:
                c = ynq(qbuf);
                if (c == 'q') return (timepassed);
                if (c == 'n') continue;
+               any = TRUE;
 
                if (cobj->olocked) {
                    pline("Hmmm, it seems to be locked.");
@@ -1460,6 +1463,7 @@ lootcont:
                if (multi < 0) return 1;                /* chest trap */
            }
        }
+       if (any) c = 'y';
     } else if (Confusion) {
 #ifndef GOLDOBJ
        if (u.ugold){