diff --git a/src/activity_item_handling.cpp b/src/activity_item_handling.cpp index 293b02e2da517..2b1ca60ed3665 100644 --- a/src/activity_item_handling.cpp +++ b/src/activity_item_handling.cpp @@ -2021,6 +2021,20 @@ void activity_on_turn_move_loot( player_activity &act, Character &you ) map &here = get_map(); const tripoint_abs_ms abspos = you.pos_abs(); zone_manager &mgr = zone_manager::get_manager(); + + std::vector crafting_items; + + for( const npc &guy : g->all_npcs() ) { + if( !guy.activity.targets.empty() ) { + for( const item_location &target : guy.activity.targets ) { + crafting_items.push_back( target.get_item() ); + } + } + } + for( const item_location &target : get_player_character().activity.targets ) { + crafting_items.push_back( target.get_item() ); + } + if( here.check_vehicle_zones( here.get_abs_sub().z() ) ) { mgr.cache_vzones(); } @@ -2155,6 +2169,16 @@ void activity_on_turn_move_loot( player_activity &act, Character &you ) break; } + // don't steal disassembly in progress + if( it->has_var( "activity_var" ) ) { + continue; + } + + // don't steal crafts in progress + if( std::find( crafting_items.begin(), crafting_items.end(), it ) != crafting_items.end() ) { + continue; + } + // skip items that allready sorted if( zone_type_id != zone_type_LOOT_CUSTOM && mgr.has( zone_type_id, src, _fac_id( you ) ) ) { continue; @@ -2328,6 +2352,16 @@ void activity_on_turn_move_loot( player_activity &act, Character &you ) continue; } + // don't steal disassembly in progress + if( thisitem.has_var( "activity_var" ) ) { + continue; + } + // don't steal crafts in progress + if( std::find( crafting_items.begin(), crafting_items.end(), it->first ) != crafting_items.end() ) { + continue; + } + + // Only if it's from a vehicle do we use the vehicle source location information. const std::optional vpr_src = it->second ? vpr : std::nullopt; const zone_type_id id = mgr.get_near_zone_type_for_item( thisitem, abspos,