Skip to content

Commit

Permalink
Merge pull request #77129 from Night-Pryanik/unload-steal
Browse files Browse the repository at this point in the history
Added check for stealing prior to unloading containers
  • Loading branch information
Maleclypse authored Oct 19, 2024
2 parents ac689be + 2cfbfe3 commit 3841a67
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/inventory_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4517,6 +4517,10 @@ std::pair<item_location, bool> unload_selector::execute()
} else if( input.action == "CONFIRM" ) {
const inventory_entry &highlighted = get_active_column().get_highlighted();
if( highlighted && highlighted.is_selectable() ) {
item to_unload = *highlighted.any_item();
if( !avatar_action::check_stealing( get_player_character(), to_unload ) ) {
return { item_location(), uistate.unload_auto_contain };
}
return { highlighted.any_item(), uistate.unload_auto_contain };
}
} else if( input.action == "CONTAIN_MODE" ) {
Expand Down

0 comments on commit 3841a67

Please sign in to comment.