From 0a2550259319b65fb825bb4d8aa7f95a3e545593 Mon Sep 17 00:00:00 2001 From: Pasi Kallinen Date: Wed, 6 Jan 2016 18:25:17 +0200 Subject: [PATCH] Fix weight of containers in lev_comp --- doc/fixes36.1 | 1 + src/sp_lev.c | 9 +++++---- 2 files changed, 6 insertions(+), 4 deletions(-) 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;