I think moving the m_consume_obj call (which will free the eaten item)
further down should fix this without causing any really wacky message
sequencing issues, but if maintaining the exact order is important
obj->unpaid and its price could be cached before the free instead.
if (dogfood(mtmp, obj) == DOGFOOD && obj->invlet)
edog->apport += (int) (200L / ((long) edog->dropdist + gm.moves
- edog->droptime));
- m_consume_obj(mtmp, obj);
if (obj->unpaid) {
/* edible item owned by shop has been thrown or kicked
by hero and caught by tame or food-tameable monst */
currency(oprice));
/* m_consume_obj->delobj->obfree will handle actual shop billing update */
}
+ m_consume_obj(mtmp, obj);
}
return (DEADMONSTER(mtmp)) ? 2 : 1;