Skip to content

Commit

Permalink
Don't allow to scan books that are owned by other character
Browse files Browse the repository at this point in the history
It was possible to scan books from merchant inventory without
buying them.

fixes CleverRaven#65840
  • Loading branch information
Demivan committed May 30, 2023
1 parent dc4fd35 commit e4c781a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/iuse.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8864,8 +8864,8 @@ std::optional<int> iuse::ebooksave( Character *p, item *it, bool t, const tripoi
}

const item_location book = game_menus::inv::titled_filter_menu(
[&ebooks]( const item & itm ) {
return itm.is_book() && itm.type->book->is_scannable && !ebooks.count( itm.typeId() );
[&ebooks, &p]( const item & itm ) {
return itm.is_book() && itm.type->book->is_scannable && !ebooks.count( itm.typeId() ) && itm.is_owned_by( *p, true );
},
*p->as_avatar(), _( "Scan which book?" ), PICKUP_RANGE );

Expand Down

0 comments on commit e4c781a

Please sign in to comment.