Fix weight of merged partially eaten food
Due to integer rounding, merging two partially eaten food rations will have wrong weight if we add the old weights together. Recalculate the weight instead. quan = 1, weight = 6 (6.675) quan = 2, weight = 13 (13.35)
This commit is contained in:
@@ -848,7 +848,7 @@ merged(struct obj **potmp, struct obj **pobj)
|
||||
otmp->owt = weight(otmp), otmp->bknown = 0;
|
||||
/* and puddings!!!1!!one! */
|
||||
else if (!Is_pudding(otmp))
|
||||
otmp->owt += obj->owt;
|
||||
otmp->owt = weight(otmp);
|
||||
if (!has_oname(otmp) && has_oname(obj))
|
||||
otmp = *potmp = oname(otmp, ONAME(obj), ONAME_SKIP_INVUPD);
|
||||
obj_extract_self(obj);
|
||||
|
||||
Reference in New Issue
Block a user