Skip to content

Commit

Permalink
fix: segfault when siphoning a vehicle with multiple tanks (#40227)
Browse files Browse the repository at this point in the history
  • Loading branch information
nphyx authored May 6, 2020
1 parent fa1c1ee commit f7d6b59
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/veh_interact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1909,7 +1909,8 @@ bool veh_interact::do_siphon( std::string &msg )
set_title( _( "Select part to siphon:" ) );

auto sel = [&]( const vehicle_part & pt ) {
return( pt.is_tank() && pt.base.contents.legacy_front().made_of( LIQUID ) );
return( pt.is_tank() && !pt.base.contents.empty() &&
pt.base.contents.only_item().made_of( LIQUID ) );
};

auto act = [&]( const vehicle_part & pt ) {
Expand Down

0 comments on commit f7d6b59

Please sign in to comment.