From: Pasi Kallinen Date: Wed, 6 Jan 2016 16:25:17 +0000 (+0200) Subject: Fix weight of containers in lev_comp X-Git-Tag: NetHack-3.6.1_RC01~1064^2~6 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0a2550259319b65fb825bb4d8aa7f95a3e545593;p=nethack Fix weight of containers in lev_comp --- diff --git a/doc/fixes36.1 b/doc/fixes36.1 index 6bdc85bad..8b999752b 100644 --- a/doc/fixes36.1 +++ b/doc/fixes36.1 @@ -99,6 +99,7 @@ zapping wand of opening at yourself, unlock carried boxes dissolve iron bars by force-fighting with wielded potion of acid poison breath leaves a trail of poison gas make vault guard accept names starting with number +fix weight of containers in special levels Platform- and/or Interface-Specific Fixes diff --git a/src/sp_lev.c b/src/sp_lev.c index 79a3bbcc8..c4428d7ad 100644 --- a/src/sp_lev.c +++ b/src/sp_lev.c @@ -1873,11 +1873,12 @@ struct mkroom *croom; } } } else { + struct obj *cobj = container_obj[container_idx - 1]; remove_object(otmp); - if (container_obj[container_idx - 1]) - (void) add_to_container(container_obj[container_idx - 1], - otmp); - else { + if (cobj) { + (void) add_to_container(cobj, otmp); + cobj->owt = weight(cobj); + } else { obj_extract_self(otmp); obfree(otmp, NULL); return;