fix #H4083 - globs preID'd as "uncursed"

I think there was also a report about this during beta testing.
Killing an ooze, slime, or pudding left a glob of same which had its
bknown flag pre-set so was immediately shown as "uncursed" even to
non-priests.  Use another way to maximize glob mergability:  allow
globs to merge even when one has bknown set and the other doesn't.
This commit is contained in:
PatR
2016-01-09 15:28:25 -08:00
parent 7e3f82ed3c
commit 3a8ce3ff98
3 changed files with 34 additions and 13 deletions

View File

@@ -2880,24 +2880,46 @@ mergable(otmp, obj)
register struct obj *otmp, *obj;
{
int objnamelth = 0, otmpnamelth = 0;
if (obj == otmp)
return FALSE; /* already the same object */
if (obj->otyp != otmp->otyp)
return FALSE; /* different types */
if (obj->nomerge) /* explicitly marked to prevent merge */
return FALSE;
/* coins of the same kind will always merge */
if (obj->oclass == COIN_CLASS)
return TRUE;
if (obj->unpaid != otmp->unpaid || obj->spe != otmp->spe
|| obj->dknown != otmp->dknown
|| (obj->bknown != otmp->bknown && !Role_if(PM_PRIEST))
|| obj->cursed != otmp->cursed || obj->blessed != otmp->blessed
|| obj->no_charge != otmp->no_charge || obj->obroken != otmp->obroken
|| obj->otrapped != otmp->otrapped || obj->lamplit != otmp->lamplit
|| obj->greased != otmp->greased || obj->oeroded != otmp->oeroded
|| obj->oeroded2 != otmp->oeroded2 || obj->bypass != otmp->bypass)
|| obj->bypass != otmp->bypass)
return FALSE;
if (obj->nomerge) /* explicitly marked to prevent merge */
if (obj->oclass == FOOD_CLASS
&& (obj->oeaten != otmp->oeaten || obj->orotten != otmp->orotten))
return FALSE;
if (obj->globby) {
/* globs won't merge if they have different bless/curse
state, but will merge non-bknown with bknown */
if (obj->bknown != otmp->bknown)
obj->bknown = otmp->bknown = 0;
if (obj->rknown != otmp->rknown)
obj->rknown = otmp->rknown = 0;
if (obj->greased != otmp->greased)
obj->greased = otmp->greased = 0;
/* checks beyond this point aren't applicable to globs */
return TRUE;
}
if ((obj->bknown != otmp->bknown && !Role_if(PM_PRIEST))
|| obj->oeroded != otmp->oeroded || obj->oeroded2 != otmp->oeroded2
|| obj->greased != otmp->greased)
return FALSE;
if ((obj->oclass == WEAPON_CLASS || obj->oclass == ARMOR_CLASS)
@@ -2905,10 +2927,6 @@ register struct obj *otmp, *obj;
|| obj->rknown != otmp->rknown))
return FALSE;
if (obj->oclass == FOOD_CLASS
&& (obj->oeaten != otmp->oeaten || obj->orotten != otmp->orotten))
return FALSE;
if (obj->otyp == CORPSE || obj->otyp == EGG || obj->otyp == TIN) {
if (obj->corpsenm != otmp->corpsenm)
return FALSE;
@@ -3413,6 +3431,7 @@ doorganize() /* inventory organizer by Del Lamb */
names, strip off the name of the one being moved */
if (olth && !obj->oartifact && !mergable(otmp, obj)) {
char *holdname = ONAME(obj);
ONAME(obj) = (char *) 0;
/* restore name iff merging is still not possible */
if (!mergable(otmp, obj)) {

View File

@@ -819,11 +819,9 @@ boolean artif;
}
if (Is_pudding(otmp)) {
otmp->globby = 1;
otmp->known = otmp->bknown = otmp->rknown = otmp->dknown = 1;
otmp->corpsenm =
PM_GRAY_OOZE + (otmp->otyp - GLOB_OF_GRAY_OOZE);
/* this ensures that they don't fail merging because of
* BUC status or other irrelevancies */
otmp->known = otmp->dknown = 1;
otmp->corpsenm = PM_GRAY_OOZE
+ (otmp->otyp - GLOB_OF_GRAY_OOZE);
} else {
if (otmp->otyp != CORPSE && otmp->otyp != MEAT_RING
&& otmp->otyp != KELP_FROND && !rn2(6)) {