Skip to content

Commit

Permalink
Small improvements to vehicle install part menu (CleverRaven#65558)
Browse files Browse the repository at this point in the history
-Appliances hidden
-NOINSTALL parts hidden
  • Loading branch information
RenechCDDA authored May 11, 2023
1 parent 3981ca7 commit 47e4293
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 14 deletions.
28 changes: 14 additions & 14 deletions src/veh_interact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2371,20 +2371,20 @@ void veh_interact::move_cursor( const point &d, int dstart_at )
if( has_critter && vp.has_flag( VPFLAG_OBSTACLE ) ) {
continue;
}
if( veh->can_mount( vd, vp.get_id() ).success() ) {
if( vp.has_flag( VPFLAG_APPLIANCE ) ) {
// exclude "appliances" from vehicle part list
continue;
}
if( vp.get_id() != vpart_shapes[ vp.name() + vp.base_item.str() ][ 0 ]->get_id() ) {
// only add first shape to install list
continue;
}
if( can_potentially_install( vp ) ) {
can_mount.push_back( &vp );
} else {
req_missing.push_back( &vp );
}
if( vp.has_flag( "NOINSTALL" ) ) {
// exclude parts that should never be installed through install menu
continue;
}
if( vp.has_flag( VPFLAG_APPLIANCE ) ) {
// exclude "appliances" from vehicle part list
continue;
}
if( vp.get_id() != vpart_shapes[ vp.name() + vp.base_item.str() ][ 0 ]->get_id() ) {
// only add first shape to install list
continue;
}
if( can_potentially_install( vp ) ) {
can_mount.push_back( &vp );
} else {
req_missing.push_back( &vp );
}
Expand Down
1 change: 1 addition & 0 deletions src/vehicle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1118,6 +1118,7 @@ ret_val<void> vehicle::can_mount( const point &dp, const vpart_id &id ) const
}

//It also has to be a real part, not the null part
//Fallback. This response should never actually be displayed as veh_interact::move_cursor now(May 2023) excludes NOINSTALL parts
const vpart_info &part = id.obj();
if( part.has_flag( "NOINSTALL" ) ) {
return ret_val<void>::make_failure( _( "Part cannot be installed." ) );
Expand Down

0 comments on commit 47e4293

Please sign in to comment.