fix #H3724 - gold pile stacking bug

Bug report included a pointer to a fix; this patch is a superset.
Gold pieces dropped on an altar by the player got their bknown flag set,
which is incorrect since bless/curse doesn't apply to coins.  If a
monster (in reported case, a slain temple priest) dropped gold there too
then the two stacks wouldn't merge.  For the normal !GOLDOBJ config, the
problem goes away as soon as the gold gets picked up.  I didn't test for
GOLDOBJ but think two inventory slots containing gold can result.

     The superset part is to not break agnostic conduct by dropping gold
on an altar since no information is revealed when doing that.

[This was one of the very last patches checked into the old cvs repository,
where the somewhat out of date message above was accidentally omitted.]
This commit is contained in:
PatR
2015-03-16 02:29:10 -07:00
parent a983a58b6a
commit 0d0711fe17
2 changed files with 11 additions and 5 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.5 do.c $NHDT-Date$ $NHDT-Branch$:$NHDT-Revision$ */
/* NetHack 3.5 do.c $NHDT-Date: 1426497723 2015/03/16 09:22:03 $ $NHDT-Branch: H3724 $:$NHDT-Revision: 1.109 $ */
/* NetHack 3.5 do.c $Date: 2014/11/18 03:10:39 $ $Revision: 1.101 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/* NetHack may be freely redistributed. See license for details. */
@@ -222,10 +222,15 @@ doaltarobj(obj) /* obj is an object dropped on an altar */
if (Blind)
return;
/* KMH, conduct */
u.uconduct.gnostic++;
if (obj->oclass != COIN_CLASS) {
/* KMH, conduct */
u.uconduct.gnostic++;
} else {
/* coins don't have bless/curse status */
obj->blessed = obj->cursed = 0;
}
if ((obj->blessed || obj->cursed) && obj->oclass != COIN_CLASS) {
if (obj->blessed || obj->cursed) {
There("is %s flash as %s %s the altar.",
an(hcolor(obj->blessed ? NH_AMBER : NH_BLACK)),
doname(obj), otense(obj, "hit"));
@@ -233,7 +238,7 @@ doaltarobj(obj) /* obj is an object dropped on an altar */
} else {
pline("%s %s on the altar.", Doname2(obj),
otense(obj, "land"));
obj->bknown = 1;
if (obj->oclass != COIN_CLASS) obj->bknown = 1;
}
}