From 4d896b1e30893f4bc9c140b2810de4f443d6eee4 Mon Sep 17 00:00:00 2001 From: Ivan Demchuk Date: Tue, 30 May 2023 14:46:18 +0300 Subject: [PATCH] # If this commit is applied, it will .... Don't allow to scan books that are owned by other character # Explain why this change is being made # |<---- Limit Each Line to a Maximum Of 72 Characters ---->| It was possible to scan books from merchant inventory without buying them. # Provide links or keys to any relevant tickets, articles or other resources # Example: fixes #1234, closes #2345, resolves #3456, references #4567 fixes #65840 --- src/iuse.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/iuse.cpp b/src/iuse.cpp index c99a10985eb0d..ae11d0a7b0267 100644 --- a/src/iuse.cpp +++ b/src/iuse.cpp @@ -8864,8 +8864,8 @@ std::optional 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 );