fix pull request #504 - partly eaten food

that has no nutritional value.  Prevent applying the partly eaten
attribute to wished for food if the full nutrition isn't at least 2.
The problem case was 0 nutrition wraith corpse, yielding "partly
eaten food (1) more nutritious than untouched food (0)" when setting
the corpse's weight.  That one was possible in 3.6.x, unlike corpse
that was actually partly eaten and then revived as a zombie (which
was just fixed for triggering the same warning).

Wishing really ought to ignore "partly eaten" for anything that is
normally eaten in one bite but I'm not sure how to handle that.

Fixes #504
This commit is contained in:
PatR
2021-05-06 17:52:30 -07:00
parent ad7f2afef9
commit cecda13ab2
4 changed files with 38 additions and 13 deletions

View File

@@ -1,4 +1,4 @@
/* NetHack 3.7 extern.h $NHDT-Date: 1620329773 2021/05/06 19:36:13 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.968 $ */
/* NetHack 3.7 extern.h $NHDT-Date: 1620348705 2021/05/07 00:51:45 $ $NHDT-Branch: NetHack-3.7 $:$NHDT-Revision: 1.969 $ */
/* Copyright (c) Steve Creps, 1988. */
/* NetHack may be freely redistributed. See license for details. */
@@ -647,6 +647,7 @@ extern boolean is_edible(struct obj *);
extern void init_uhunger(void);
extern int Hear_again(void);
extern void reset_eat(void);
extern unsigned obj_nutrition(struct obj *);
extern int doeat(void);
extern int use_tin_opener(struct obj *);
extern void gethungry(void);