diff --git a/src/vehicle.cpp b/src/vehicle.cpp index 2e34627ae2680..52b56846763bb 100644 --- a/src/vehicle.cpp +++ b/src/vehicle.cpp @@ -7669,7 +7669,8 @@ void vehicle::leak_fuel( vehicle_part &pt ) const // leak in random directions but prefer closest tiles and avoid walls or other obstacles std::vector tiles; tiles.reserve( 9 ); - find_point_closest_first( global_part_pos3( pt ), 1, [&here, &tiles]( const tripoint & e ) { + tripoint part_pos = global_part_pos3( pt ); + find_point_closest_first( part_pos, 1, [&here, &tiles]( const tripoint & e ) { if( here.passable( e ) ) { tiles.push_back( e ); }