From dec49a72a1697f1313988a643abe4cb49e0783e6 Mon Sep 17 00:00:00 2001 From: Valiant Date: Sat, 5 Oct 2024 12:43:26 +0400 Subject: [PATCH] Added check for stealing prior to inserting items into container --- src/inventory_ui.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/inventory_ui.cpp b/src/inventory_ui.cpp index c473b189e48d2..845e0e05a4c8e 100644 --- a/src/inventory_ui.cpp +++ b/src/inventory_ui.cpp @@ -4,6 +4,7 @@ #include #include "activity_actor_definitions.h" +#include "avatar_action.h" #include "basecamp.h" #include "cata_assert.h" #include "cata_utility.h" @@ -4014,6 +4015,12 @@ drop_locations inventory_drop_selector::execute() const inventory_input input = get_input(); if( input.action == "CONFIRM" ) { + for( drop_location &stuff : to_use ) { + if( !avatar_action::check_stealing( get_player_character(), *stuff.first ) ) { + return drop_locations(); + } + } + if( to_use.empty() ) { popup_getkey( _( "No items were selected. Use %s to select them." ), ctxt.get_desc( "TOGGLE_ENTRY" ) );