From 349abcb9f54302f25d45c10bb3f75e92db30f3c0 Mon Sep 17 00:00:00 2001 From: Eric Pierce Date: Sat, 13 Jun 2020 02:20:11 -0600 Subject: [PATCH] Lockpick doors with 'e' if prying is not available (#41265) * Try picking if can't pry and door is pickable For locked doors with "examine_action": "locked_object", if no prying tool is available, check to see if the object has the PICKABLE flag, and if so, try picking it using iexamine::locked_object_pickable. * Include prying suggestion before trying to pick --- src/iexamine.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/iexamine.cpp b/src/iexamine.cpp index f0f40b4815ed8..534b23df46f2e 100644 --- a/src/iexamine.cpp +++ b/src/iexamine.cpp @@ -203,6 +203,7 @@ static const std::string flag_NO_PACKED( "NO_PACKED" ); static const std::string flag_NO_STERILE( "NO_STERILE" ); static const std::string flag_NUTRIENT_OVERRIDE( "NUTRIENT_OVERRIDE" ); static const std::string flag_OPENCLOSE_INSIDE( "OPENCLOSE_INSIDE" ); +static const std::string flag_PICKABLE( "PICKABLE" ); static const std::string flag_PROCESSING( "PROCESSING" ); static const std::string flag_PROCESSING_RESULT( "PROCESSING_RESULT" ); static const std::string flag_SAFECRACK( "SAFECRACK" ); @@ -1386,8 +1387,14 @@ void iexamine::locked_object( player &p, const tripoint &examp ) } ); if( prying_items.empty() ) { - add_msg( m_info, _( "The %s is locked. If only you had something to pry it with…" ), - g->m.has_furn( examp ) ? g->m.furnname( examp ) : g->m.tername( examp ) ); + if( g->m.has_flag( flag_PICKABLE, examp ) ) { + add_msg( m_info, _( "The %s is locked. You could pry it open with the right tool…" ), + g->m.has_furn( examp ) ? g->m.furnname( examp ) : g->m.tername( examp ) ); + locked_object_pickable( p, examp ); + } else { + add_msg( m_info, _( "The %s is locked. If only you had something to pry it with…" ), + g->m.has_furn( examp ) ? g->m.furnname( examp ) : g->m.tername( examp ) ); + } return; }