Skip to content

Commit

Permalink
fix duplicate entry debug message while eating (#38031)
Browse files Browse the repository at this point in the history
  • Loading branch information
KorGgenT authored Feb 15, 2020
1 parent e182e64 commit 294acf6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/inventory_ui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -713,7 +713,9 @@ void inventory_column::add_entry( const inventory_entry &entry )
void inventory_column::move_entries_to( inventory_column &dest )
{
for( const auto &elem : entries ) {
if( elem.is_item() ) {
if( elem.is_item() &&
// this column already has this entry, no need to try to add it again
std::find( dest.entries.begin(), dest.entries.end(), elem ) == dest.entries.end() ) {
dest.add_entry( elem );
}
}
Expand Down

0 comments on commit 294acf6

Please sign in to comment.