diff --git a/doc/fixes3-7-0.txt b/doc/fixes3-7-0.txt index d4c581bc0..f6b7b1eb0 100644 --- a/doc/fixes3-7-0.txt +++ b/doc/fixes3-7-0.txt @@ -1156,6 +1156,9 @@ wearing the Eyes of the Overworld overrides OPTIONS:blind; breaking the blindness stay cured after removing them was not change helm of brilliance from iron to crystal so that it no longer needs to be a special case for metallic armor vs spell casting +fake player monsters in endgame had a 1 in 1000 chance to be given a stack + of 0 gold pieces, eventually triggering an impossible warning (cited + one was "Calculating weight of 0 gold pieces?") Fixes to 3.7.0-x General Problems Exposed Via git Repository diff --git a/src/makemon.c b/src/makemon.c index 950f5e363..3e0490e2a 100644 --- a/src/makemon.c +++ b/src/makemon.c @@ -558,16 +558,18 @@ m_initweap(register struct monst *mtmp) (void) mongets(mtmp, rnd_offensive_item(mtmp)); } -/* - * Makes up money for monster's inventory. - */ +/* create a new stack of gold in monster's inventory */ void mkmonmoney(struct monst *mtmp, long amount) { - struct obj *gold = mksobj(GOLD_PIECE, FALSE, FALSE); + /* mk_mplayer() passes rn2(1000) so the amount might be 0 */ + if (amount > 0L) { + struct obj *gold = mksobj(GOLD_PIECE, FALSE, FALSE); - gold->quan = amount; - add_to_minv(mtmp, gold); + gold->quan = amount; + gold->owt = weight(gold); + add_to_minv(mtmp, gold); + } } static void