Skip to content

Commit

Permalink
Fixed gunsafe's logic. (#36651)
Browse files Browse the repository at this point in the history
  • Loading branch information
Kelenius authored and kevingranade committed Jan 3, 2020
1 parent c3a2c46 commit 828501c
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions src/iexamine.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1240,22 +1240,21 @@ void iexamine::safe( player &p, const tripoint &examp )
*/
void iexamine::gunsafe_ml( player &p, const tripoint &examp )
{
if( !( p.has_amount( "crude_picklock", 1 ) || p.has_amount( "hairpin", 1 ) ||
p.has_amount( "fc_hairpin", 1 ) ||
p.has_amount( "picklocks", 1 ) || p.has_bionic( bionic_id( "bio_lockpick" ) ) ) ) {
add_msg( m_info, _( "You need a lockpick to open this gun safe." ) );
return;
} else if( !query_yn( _( "Pick the gun safe?" ) ) ) {
return;
}
int pick_quality = 0;

int pick_quality = 1;
if( p.has_amount( "picklocks", 1 ) || p.has_bionic( bionic_id( "bio_lockpick" ) ) ) {
pick_quality = 5;
} else if( p.has_amount( "crude_picklock", 1 ) || p.has_amount( "hairpin", 1 ) ) {
pick_quality = 3;
} else if( p.has_amount( "fc_hairpin", 1 ) ) {
pick_quality = 1;
} else {
pick_quality = 3;
}

if( pick_quality == 0 ) {
add_msg( m_info, _( "You need a lockpick to open this gun safe." ) );
return;
} else if( !query_yn( _( "Pick the gun safe?" ) ) ) {
return;
}

p.practice( skill_mechanics, 1 );
Expand Down

0 comments on commit 828501c

Please sign in to comment.