Fix: bill_dummy_obj billed excessively for stacks
Add a way to request that unpaid_cost() produce the cost for a single item, which is necessary for the price adjustment made in bill_dummy_object. Another option would be to simply divide by quan in bill_dummy_object, but this might be more future-proof in case unpaid_cost ever involves more than simple multiplication by quan (e.g. the use of alternate units vs the base price, as are used for globs). Fixes #1236
This commit is contained in:
@@ -314,7 +314,7 @@ dog_eat(struct monst *mtmp,
|
||||
if (obj->unpaid) {
|
||||
/* edible item owned by shop has been thrown or kicked
|
||||
by hero and caught by tame or food-tameable monst */
|
||||
oprice = unpaid_cost(obj, TRUE);
|
||||
oprice = unpaid_cost(obj, COST_CONTENTS);
|
||||
pline("That %s will cost you %ld %s.", objnambuf, oprice,
|
||||
currency(oprice));
|
||||
/* m_consume_obj->delobj->obfree will handle actual shop billing update */
|
||||
|
||||
Reference in New Issue
Block a user