From b5276ed2a0eedae65a4bcc27139c3a05148e4bed Mon Sep 17 00:00:00 2001 From: cohrs Date: Wed, 15 May 2002 05:10:06 +0000 Subject: [PATCH] looting containers and monsters 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 | 1 + src/pickup.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/doc/fixes34.1 b/doc/fixes34.1 index c5f588220..fe8477c81 100644 --- a/doc/fixes34.1 +++ b/doc/fixes34.1 @@ -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 diff --git a/src/pickup.c b/src/pickup.c index 27fff2d97..b62d1c85d 100644 --- a/src/pickup.c +++ b/src/pickup.c @@ -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){ -- 2.40.0