object name assignment vs persistent inventory

This is an alternate way to deal with pull request #876, where
splitting a stack that has a name assigned updated perm_invent when
cloning the name and ran into trouble with shop billing when trying
to format for persistent inventory display.

The PR#876 fix has been left in place but wouldn't have been needed
if this had gone in first.
This commit is contained in:
PatR
2022-09-26 14:25:06 -07:00
parent caf1eeebf9
commit 0735b790f9
4 changed files with 9 additions and 6 deletions

View File

@@ -359,7 +359,7 @@ copy_oextra(struct obj *obj2, struct obj *obj1)
if (!obj2->oextra)
obj2->oextra = newoextra();
if (has_oname(obj1))
oname(obj2, ONAME(obj1), ONAME_NO_FLAGS);
oname(obj2, ONAME(obj1), ONAME_SKIP_INVUPD);
if (has_omonst(obj1)) {
if (!OMONST(obj2))
newomonst(obj2);
@@ -427,7 +427,7 @@ splitobj(struct obj *obj, long num)
splitbill(obj, otmp);
copy_oextra(otmp, obj);
if (has_omid(otmp))
free_omid(otmp); /* only one association with m_id*/
free_omid(otmp); /* only one association with m_id */
if (obj->timed)
obj_split_timers(obj, otmp);
if (obj_sheds_light(obj))