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