more weight tweaks

Update some potential weight issues.  Eggs won't hatch when in
containers so they weren't affected but add some bulletproofing.
Corpse revival from inside containers was already ok too, so
effectively there's no change except for making container_weight() be
global instead of local to mkobj.c.
This commit is contained in:
PatR
2024-01-25 23:09:12 -08:00
parent ec4691a859
commit 9cd1a571ae
4 changed files with 20 additions and 16 deletions

View File

@@ -1069,6 +1069,7 @@ revive(struct obj *corpse, boolean by_hero)
m_useup(corpse->ocarry, corpse);
break;
case OBJ_CONTAINED:
/* obj_extract_self() will update corpse->ocontainer->owt */
obj_extract_self(corpse);
obfree(corpse, (struct obj *) 0);
break;