fix #H8072 - failing wish segfaults

Having an artifact wish be refused uses zeroobj and code which
followed was attempting to update its weight, triggering a segfault
now that zeroobj is 'const'.
This commit is contained in:
PatR
2019-01-28 09:10:52 -08:00
parent 1083971228
commit 30237c73ec
2 changed files with 5 additions and 2 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.6 objnam.c $NHDT-Date: 1547025168 2019/01/09 09:12:48 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.233 $ */
/* NetHack 3.6 objnam.c $NHDT-Date: 1548695445 2019/01/28 17:10:45 $ $NHDT-Branch: NetHack-3.6.2-beta01 $:$NHDT-Revision: 1.234 $ */
/* Copyright (c) Stichting Mathematisch Centrum, Amsterdam, 1985. */
/*-Copyright (c) Robert Patrick Rankin, 2011. */
/* NetHack may be freely redistributed. See license for details. */
@@ -3984,6 +3984,7 @@ struct obj *no_wish;
otmp = (struct obj *) &zeroobj;
pline("For a moment, you feel %s in your %s, but it disappears!",
something, makeplural(body_part(HAND)));
return otmp;
}
if (halfeaten && otmp->oclass == FOOD_CLASS) {