]> granicus.if.org Git - nethack/commitdiff
Fix weight of containers in lev_comp
authorPasi Kallinen <paxed@alt.org>
Wed, 6 Jan 2016 16:25:17 +0000 (18:25 +0200)
committerPasi Kallinen <paxed@alt.org>
Wed, 6 Jan 2016 16:25:50 +0000 (18:25 +0200)
doc/fixes36.1
src/sp_lev.c

index 6bdc85badad4dd8fe8f808c4930e9f3cc03b6e19..8b999752b3389caa842976846826a3e8eb850191 100644 (file)
@@ -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
index 79a3bbcc81b2b6b3708a511efb1d71afea83af0b..c4428d7adb779cfa46bff6c20c4409016ebb35e9 100644 (file)
@@ -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;