diff --git a/src/vehicle_use.cpp b/src/vehicle_use.cpp index ee4d22974f6cb..4909c94172f7b 100644 --- a/src/vehicle_use.cpp +++ b/src/vehicle_use.cpp @@ -2092,11 +2092,12 @@ void vehicle::build_interact_menu( veh_menu &menu, const tripoint &p, bool with_ // Remove attached tools that have become incompatible with workstation because of migration etc if( vp.avail_part_with_feature( "VEH_TOOLS" ) && !vp.get_tools().empty() ) { const std::optional vp_toolstation = vp.avail_part_with_feature( "VEH_TOOLS" ); - if( vp_toolstation->info().toolkit_info ) { - const std::set &allowed_tool_types = vp_toolstation->info().toolkit_info->allowed_types; + const vpart_info vp_info = vp_toolstation->info(); + if( vp_info.toolkit_info ) { + const std::set &allowed_tool_types = vp_info.toolkit_info->allowed_types; std::set builtin_tool_types; - for( const auto &[tool_type, _] : vp_toolstation->info().get_pseudo_tools() ) { + for( const auto &[tool_type, _] : vp_info.get_pseudo_tools() ) { builtin_tool_types.insert( tool_type ); }