Skip to content

Commit

Permalink
Merge pull request #69624 from Fris0uman/dude_whers_my_car
Browse files Browse the repository at this point in the history
Fix vehicle being mergeable into powergrids
  • Loading branch information
akrieger authored Dec 2, 2023
2 parents d9741cd + b9dc92d commit dac4ed2
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/action.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1189,5 +1189,10 @@ std::optional<tripoint> choose_adjacent_highlight( const tripoint &pos, const st
g->add_draw_callback( hilite_cb );
}

return choose_adjacent( pos, message, allow_vertical );
const std::optional<tripoint> chosen = choose_adjacent( pos, message, allow_vertical );
if( std::find( valid.begin(), valid.end(), chosen ) != valid.end() ) {
return chosen;
}

return std::nullopt;
}
2 changes: 1 addition & 1 deletion src/veh_appliance.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -527,7 +527,7 @@ void veh_app_interact::merge()
return false;
}
vehicle &target_veh = target_vp->vehicle();
if( !target_veh.has_tag( flag_APPLIANCE ) || !target_veh.is_powergrid() ) {
if( !target_veh.is_powergrid() ) {
return false;
}
return true;
Expand Down

0 comments on commit dac4ed2

Please sign in to comment.