Skip to content

Commit

Permalink
Merge pull request CleverRaven#76826 from Night-Pryanik/stealing
Browse files Browse the repository at this point in the history
Added check for stealing prior to inserting items into container
  • Loading branch information
Maleclypse authored Oct 5, 2024
2 parents a26f6ea + dec49a7 commit f71f48d
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/inventory_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#include <optional>

#include "activity_actor_definitions.h"
#include "avatar_action.h"
#include "basecamp.h"
#include "cata_assert.h"
#include "cata_utility.h"
Expand Down Expand Up @@ -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" ) );
Expand Down

0 comments on commit f71f48d

Please sign in to comment.