Skip to content

Commit

Permalink
Fix appliance wall wiring removal (#57011)
Browse files Browse the repository at this point in the history
Co-Authored-By: andrei <[email protected]>

Co-authored-by: andrei <[email protected]>
  • Loading branch information
ZombieZilla and andrei8l authored Apr 22, 2022
1 parent e0413ae commit 4ba96aa
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/veh_appliance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,8 @@ void veh_app_interact::rename()

void veh_app_interact::remove()
{
vehicle_part &vp = veh->part( veh->part_at( a_point ) );
int const part = veh->part_at( a_point );
vehicle_part &vp = veh->part( part >= 0 ? part : 0 );
const vpart_info &vpinfo = vp.info();
const requirement_data reqs = vpinfo.removal_requirements();
Character &you = get_player_character();
Expand Down
2 changes: 2 additions & 0 deletions src/veh_interact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3500,6 +3500,8 @@ void veh_interact::complete_vehicle( Character &you )
}
}
veh->part_removal_cleanup();
//always stop after removing an appliance
you.activity.set_to_null();
}

if( veh->part_count() < 2 ) {
Expand Down
2 changes: 1 addition & 1 deletion src/vehicle_use.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2415,7 +2415,7 @@ void vehicle::interact_with( const vpart_position &vp, bool with_pickup )
}
case EXAMINE: {
if( is_appliance ) {
g->exam_appliance( *this );
g->exam_appliance( *this, vp.mount() );
} else {
g->exam_vehicle( *this );
}
Expand Down

0 comments on commit 4ba96aa

Please sign in to comment.