diff --git a/src/activity_actor_definitions.h b/src/activity_actor_definitions.h index d57f68b9d7fa9..56397e22db89c 100644 --- a/src/activity_actor_definitions.h +++ b/src/activity_actor_definitions.h @@ -1256,7 +1256,7 @@ class disassemble_activity_actor : public activity_actor int moves_total; float activity_override = NO_EXERCISE; // NOLINT(cata-serialize) float cached_workbench_multiplier; // NOLINT(cata-serialize) - bool use_cached_workbench_multiplier; // NOLINT(cata-serialize) + bool use_cached_workbench_multiplier = false; // NOLINT(cata-serialize) public: item_location target; diff --git a/src/visitable.cpp b/src/visitable.cpp index 95a3aa78847fd..9e09f7bd72d9e 100644 --- a/src/visitable.cpp +++ b/src/visitable.cpp @@ -471,8 +471,13 @@ const VisitResponse map_cursor::visit_items( const std::function &func ) const { - map &here = get_map(); - tripoint p = pos().raw(); + smallmap here; // tinymap would work as well, as we're only looking at a single position. + // pos returns the pos_bub location of the target relative to the reality bubble + // even if the location isn't actually inside of it. Thus, we're loading a map + // around that location to do our work. + tripoint_abs_ms abs_pos = get_map().getglobal( pos() ); + here.load( project_to( abs_pos ), false ); + tripoint_omt_ms p = tripoint_omt_ms( here.getlocal( abs_pos ) ); // check furniture pseudo items if( here.furn( p ) != furn_str_id::NULL_ID() ) { @@ -486,12 +491,12 @@ VisitResponse map_cursor::visit_items( } // skip inaccessible items - if( here.has_flag( ter_furn_flag::TFLAG_SEALED, p ) && - !here.has_flag( ter_furn_flag::TFLAG_LIQUIDCONT, p ) ) { + if( here.has_flag( ter_furn_flag::TFLAG_SEALED, p.raw() ) && + !here.has_flag( ter_furn_flag::TFLAG_LIQUIDCONT, p.raw() ) ) { return VisitResponse::NEXT; } - for( item &e : here.i_at( p ) ) { + for( item &e : here.i_at( p.raw() ) ) { if( visit_internal( func, &e ) == VisitResponse::ABORT ) { return VisitResponse::ABORT; }