Make GOLDOBJ unconditional.
This commit is contained in:
39
src/detect.c
39
src/detect.c
@@ -91,12 +91,7 @@ unsigned material;
|
||||
/* there's some object shown here */
|
||||
if (oclass == ALL_CLASSES) {
|
||||
return((boolean)( !(level.objects[x][y] || /* stale if nothing here */
|
||||
((mtmp = m_at(x,y)) != 0 &&
|
||||
(
|
||||
#ifndef GOLDOBJ
|
||||
mtmp->mgold ||
|
||||
#endif
|
||||
mtmp->minvent)))));
|
||||
((mtmp = m_at(x,y)) != 0 && ( mtmp->minvent)))));
|
||||
} else {
|
||||
if (material && objects[glyph_to_obj(glyph)].oc_material == material) {
|
||||
/* the object shown here is of interest because material matches */
|
||||
@@ -115,19 +110,10 @@ unsigned material;
|
||||
for (otmp = level.objects[x][y]; otmp; otmp = otmp->nexthere)
|
||||
if (o_in(otmp, oclass)) return FALSE;
|
||||
/* didn't find it; perhaps a monster is carrying it */
|
||||
#ifndef GOLDOBJ
|
||||
if ((mtmp = m_at(x,y)) != 0) {
|
||||
if (oclass == COIN_CLASS && mtmp->mgold)
|
||||
return FALSE;
|
||||
else for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
|
||||
if (o_in(otmp, oclass)) return FALSE;
|
||||
}
|
||||
#else
|
||||
if ((mtmp = m_at(x,y)) != 0) {
|
||||
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
|
||||
if (o_in(otmp, oclass)) return FALSE;
|
||||
}
|
||||
#endif
|
||||
/* detection indicates removal of this object from the map */
|
||||
return TRUE;
|
||||
}
|
||||
@@ -176,11 +162,7 @@ register struct obj *sobj;
|
||||
/* look for gold carried by monsters (might be in a container) */
|
||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||
if (DEADMONSTER(mtmp)) continue; /* probably not needed in this case but... */
|
||||
#ifndef GOLDOBJ
|
||||
if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
|
||||
#else
|
||||
if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
|
||||
#endif
|
||||
known = TRUE;
|
||||
goto outgoldmap; /* skip further searching */
|
||||
} else for (obj = mtmp->minvent; obj; obj = obj->nobj)
|
||||
@@ -212,12 +194,7 @@ register struct obj *sobj;
|
||||
if (youmonst.data == &mons[PM_GOLD_GOLEM]) {
|
||||
Sprintf(buf, "You feel like a million %s!",
|
||||
currency(2L));
|
||||
} else if (hidden_gold() ||
|
||||
#ifndef GOLDOBJ
|
||||
u.ugold)
|
||||
#else
|
||||
money_cnt(invent))
|
||||
#endif
|
||||
} else if (hidden_gold() || money_cnt(invent))
|
||||
Strcpy(buf,
|
||||
"You feel worried about your future financial situation.");
|
||||
else
|
||||
@@ -254,11 +231,7 @@ outgoldmap:
|
||||
}
|
||||
for (mtmp = fmon; mtmp; mtmp = mtmp->nmon) {
|
||||
if (DEADMONSTER(mtmp)) continue; /* probably overkill here */
|
||||
#ifndef GOLDOBJ
|
||||
if (mtmp->mgold || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
|
||||
#else
|
||||
if (findgold(mtmp->minvent) || monsndx(mtmp->data) == PM_GOLD_GOLEM) {
|
||||
#endif
|
||||
struct obj gold;
|
||||
gold = zeroobj; /* ensure oextra is cleared too */
|
||||
gold.otyp = GOLD_PIECE;
|
||||
@@ -460,11 +433,7 @@ int class; /* an object class, 0 for all */
|
||||
}
|
||||
if ((is_cursed && mtmp->m_ap_type == M_AP_OBJECT &&
|
||||
(!class || class == objects[mtmp->mappearance].oc_class)) ||
|
||||
#ifndef GOLDOBJ
|
||||
(mtmp->mgold && (!class || class == COIN_CLASS))) {
|
||||
#else
|
||||
(findgold(mtmp->minvent) && (!class || class == COIN_CLASS))) {
|
||||
#endif
|
||||
ct++;
|
||||
break;
|
||||
}
|
||||
@@ -546,11 +515,7 @@ int class; /* an object class, 0 for all */
|
||||
temp.oy = mtmp->my;
|
||||
temp.corpsenm = PM_TENGU; /* if mimicing a corpse */
|
||||
map_object(&temp, 1);
|
||||
#ifndef GOLDOBJ
|
||||
} else if (mtmp->mgold && (!class || class == COIN_CLASS)) {
|
||||
#else
|
||||
} else if (findgold(mtmp->minvent) && (!class || class == COIN_CLASS)) {
|
||||
#endif
|
||||
struct obj gold;
|
||||
gold = zeroobj; /* ensure oextra is cleared too */
|
||||
gold.otyp = GOLD_PIECE;
|
||||
|
||||
Reference in New Issue
Block a user