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
|
||||
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
|
||||
|
||||
@@ -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){
|
||||
|
||||
Reference in New Issue
Block a user