Skip to content

Commit

Permalink
small fixes to efile system
Browse files Browse the repository at this point in the history
  • Loading branch information
ShnitzelX2 committed Jan 23, 2025
1 parent ad676f9 commit c46106f
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 14 deletions.
10 changes: 0 additions & 10 deletions data/json/itemgroups/efiles.json
Original file line number Diff line number Diff line change
@@ -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",
Expand Down
4 changes: 2 additions & 2 deletions data/json/items/software.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
3 changes: 2 additions & 1 deletion src/game_inventory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 &&
Expand Down
2 changes: 1 addition & 1 deletion src/item.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit c46106f

Please sign in to comment.