From 778f5b6e7c1923291e4876a770f3e7c704c4592a Mon Sep 17 00:00:00 2001 From: RenechCDDA <84619419+RenechCDDA@users.noreply.github.com> Date: Fri, 24 May 2024 16:00:05 +0100 Subject: [PATCH] Merge pull request #72608 from RenechCDDA/unsealed_evil_in_a_can --- src/item.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/item.cpp b/src/item.cpp index 375ef3048eb0c..4a4bb13985a39 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -12017,6 +12017,13 @@ bool item::use_amount( const itype_id &it, int &quantity, std::list &used, } for( item *removed : removed_items ) { + // Handle cases where items are removed but the pocket isn't emptied + item *parent = this->find_parent( *removed ); + for( item_pocket *pocket : parent->get_all_standard_pockets() ) { + if( pocket->has_item( *removed ) ) { + pocket->unseal(); + } + } this->remove_item( *removed ); }