diff --git a/src/libslic3r/GCode/WipeTower.hpp b/src/libslic3r/GCode/WipeTower.hpp index 1226cc003..37a3e1e62 100644 --- a/src/libslic3r/GCode/WipeTower.hpp +++ b/src/libslic3r/GCode/WipeTower.hpp @@ -301,10 +301,10 @@ public: void set_filament_map(const std::vector &filament_map) { m_filament_map = filament_map; } void set_has_tpu_filament(bool has_tpu) { m_has_tpu_filament = has_tpu; } - void set_need_reverse_travel() { - for (int i = 0; i < m_filpar.size(); i++) { - if(m_filpar[i].ramming_travel_time>EPSILON) - { + void set_need_reverse_travel(const std::vector & used_extruders) + { + for (unsigned int filament_id : used_extruders) { + if (m_filpar[filament_id].ramming_travel_time > EPSILON) { m_need_reverse_travel = true; return; } diff --git a/src/libslic3r/Print.cpp b/src/libslic3r/Print.cpp index 68f2f1103..c6a95f311 100644 --- a/src/libslic3r/Print.cpp +++ b/src/libslic3r/Print.cpp @@ -2685,7 +2685,7 @@ void Print::_make_wipe_tower() // Set the extruder & material properties at the wipe tower object. for (size_t i = 0; i < number_of_extruders; ++ i) wipe_tower.set_extruder(i, m_config); - wipe_tower.set_need_reverse_travel(); + wipe_tower.set_need_reverse_travel(m_wipe_tower_data.tool_ordering.all_extruders()); // BBS: remove priming logic //m_wipe_tower_data.priming = Slic3r::make_unique>( // wipe_tower.prime((float)this->skirt_first_layer_height(), m_wipe_tower_data.tool_ordering.all_extruders(), false));