1
0
Fork 0
mirror of https://codeberg.org/noisytoot/notnotdnethack.git synced 2025-05-03 13:55:10 +01:00

Fix to meating bug

This commit is contained in:
Chris-plus-alphanumericgibberish 2014-10-01 22:42:39 -04:00
parent cf04f48636
commit e25598cb1c

View file

@ -439,19 +439,18 @@ register struct edog *edog;
/* We're hungry; check if we're carrying anything we can eat
Intelligent pets should be able to carry such food */
register struct obj *otmp, *obest = (struct obj *)0;
int cur_nutrit = -1, best_nutrit = -1;
int best_nutrit = -1; //cur_nutrit = -1,
int cur_food = APPORT, best_food = APPORT;
for (otmp = mtmp->minvent; otmp; otmp = otmp->nobj)
{
cur_nutrit = dog_nutrition(mtmp, otmp);
// cur_nutrit = dog_nutrition(mtmp, otmp);
cur_food = dogfood(mtmp, otmp);
if (cur_food < best_food &&
cur_nutrit > best_nutrit)
{
best_nutrit = cur_nutrit;
best_food = cur_food;
obest = otmp;
}
if (cur_food < best_food) /*&& cur_nutrit > best_nutrit)*/
{
// best_nutrit = cur_nutrit;
best_food = cur_food;
obest = otmp;
}
}
if (obest != (struct obj *)0)
{