Skip to content

Commit

Permalink
'Remove attached part first.' message displays the part name (#37922)
Browse files Browse the repository at this point in the history
  • Loading branch information
AMurkin authored Feb 11, 2020
1 parent ae561f6 commit b75d7db
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1579,7 +1579,7 @@ bool vehicle::can_unmount( const int p, std::string &reason ) const
std::make_tuple( "ENGINE", "ALTERNATOR", translate_marker( "Remove attached alternator first." ) ),
std::make_tuple( "BELTABLE", "SEATBELT", translate_marker( "Remove attached seatbelt first." ) ),
std::make_tuple( "WINDOW", "CURTAIN", translate_marker( "Remove attached curtains first." ) ),
std::make_tuple( "CONTROLS", "ON_CONTROLS", translate_marker( "Remove attached part first." ) ),
std::make_tuple( "CONTROLS", "ON_CONTROLS", translate_marker( "Remove the attached %s first." ) ),
std::make_tuple( "BATTERY_MOUNT", "NEEDS_BATTERY_MOUNT", translate_marker( "Remove battery from mount first." ) ),
std::make_tuple( "TURRET_MOUNT", "TURRET", translate_marker( "Remove attached mounted weapon first." ) ),
std::make_tuple( "WHEEL_MOUNT_LIGHT", "NEEDS_WHEEL_MOUNT_LIGHT", translate_marker( "Remove attached wheel first." ) ),
Expand All @@ -1588,9 +1588,9 @@ bool vehicle::can_unmount( const int p, std::string &reason ) const
}
};
for( auto &flag_check : blocking_flags ) {
if( part_flag( p, std::get<0>( flag_check ) ) &&
part_with_feature( p, std::get<1>( flag_check ), false ) >= 0 ) {
reason = _( std::get<2>( flag_check ) );
const int part_idx_requires = part_with_feature( p, std::get<1>( flag_check ), false );
if( part_flag( p, std::get<0>( flag_check ) ) && part_idx_requires >= 0 ) {
reason = string_format( _( std::get<2>( flag_check ) ), parts[part_idx_requires].info().name() );
return false;
}
}
Expand Down

0 comments on commit b75d7db

Please sign in to comment.