From c46106f7a4075e6d432578f2acfb16f64a3e49c1 Mon Sep 17 00:00:00 2001 From: ShnitzelX2 <65314588+ShnitzelX2@users.noreply.github.com> Date: Tue, 21 Jan 2025 20:03:18 -0500 Subject: [PATCH] small fixes to efile system --- data/json/itemgroups/efiles.json | 10 ---------- data/json/items/software.json | 4 ++-- src/game_inventory.cpp | 3 ++- src/item.cpp | 2 +- 4 files changed, 5 insertions(+), 14 deletions(-) diff --git a/data/json/itemgroups/efiles.json b/data/json/itemgroups/efiles.json index c17900c00ff6a..79f8ff7f62add 100644 --- a/data/json/itemgroups/efiles.json +++ b/data/json/itemgroups/efiles.json @@ -1,14 +1,4 @@ [ - { - "id": "laptop_files_work", - "type": "item_group", - "subtype": "collection", - "entries": [ - { "item": "book_nonf_hard_homemk_anythingcan", "prob": 100, "count": 1 }, - { "item": "book_nonf_hard_homemk_grtrms", "prob": 100, "count": 1 }, - { "item": "book_nonf_hard_homemk_handshome", "prob": 100, "count": 1 } - ] - }, { "id": "edevice_work", "type": "item_group", diff --git a/data/json/items/software.json b/data/json/items/software.json index eefc4a7f4314e..b22920f708fa3 100644 --- a/data/json/items/software.json +++ b/data/json/items/software.json @@ -111,13 +111,13 @@ }, { "abstract": "abstract_efile_copiable", + "copy-from": "abstract_efile", "type": "GENERIC", "symbol": "o", "name": "abstract copiable electronic file", "description": "abstract copiable electronic file", "ememory_size": "1 KB", - "flags": [ "E_STORABLE", "ZERO_WEIGHT", "NO_DROP", "IRREMOVABLE", "E_COPIABLE" ], - "variables": { "browsed": "false" } + "extend": { "flags": [ "E_COPIABLE" ] } }, { "abstract": "abstract_efile_read", diff --git a/src/game_inventory.cpp b/src/game_inventory.cpp index dcf360102b542..a3c2b2bdde2d9 100644 --- a/src/game_inventory.cpp +++ b/src/game_inventory.cpp @@ -1678,7 +1678,8 @@ drop_locations game_menus::inv::edevice_select( Character &who, item_location &u bool has_use_check = !unusable_only || !efile_activity_actor::edevice_has_use( loc.get_item() ); bool browsed_equal_check = browse_equals == loc->is_browsed(); bool fast_transfer = compat == efile_activity_actor::edevice_compatible::ECOMPAT_FAST; - bool compatible_check = browse_equals || //if browsing, no compatibility check + bool compatible_check = ( action == EF_BROWSE && browse_equals ) || + //if browsing, no compatibility check ( action == EF_READ && fast_transfer ) || //if reading, only fast-compatible edevices compat != efile_activity_actor::edevice_compatible::ECOMPAT_NONE; //otherwise, any compatible edevice bool preset_bool = is_tool_has_charge && diff --git a/src/item.cpp b/src/item.cpp index d35d778861ffd..31616f021267f 100644 --- a/src/item.cpp +++ b/src/item.cpp @@ -8852,7 +8852,7 @@ void item::set_browsed( bool browsed ) bool item::is_ecopiable() const { - return has_flag( flag_E_COPIABLE ) || ( type->book && type->book->chapters == 0 ); + return has_flag( flag_E_COPIABLE ) || ( is_book() && get_chapters() == 0 ); } bool item::efiles_all_browsed() const