Revert "Bugfix: When specific wipe tower extruder is set, the extruder indices for the placeholder parser are shifted"

This reverts commit 2d6d37f68572419c7051178de9e4e61051641dc9.
This commit is contained in:
Lukas Matena 2023-07-12 09:52:59 +02:00
parent d907a004cf
commit 4092da7aef

View File

@ -470,16 +470,20 @@ void ToolOrdering::fill_wipe_tower_partitions(const PrintConfig &config, coordf_
bool ToolOrdering::insert_wipe_tower_extruder() bool ToolOrdering::insert_wipe_tower_extruder()
{ {
// In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list. // In case that wipe_tower_extruder is set to non-zero, we must make sure that the extruder will be in the list.
// The list is 1-based, as is the config value !
bool changed = false; bool changed = false;
if (m_print_config_ptr->wipe_tower_extruder != 0) { if (m_print_config_ptr->wipe_tower_extruder != 0) {
for (LayerTools& lt : m_layer_tools) { for (LayerTools& lt : m_layer_tools) {
if (lt.wipe_tower_partitions > 0) { if (lt.wipe_tower_partitions > 0) {
lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder); lt.extruders.emplace_back(m_print_config_ptr->wipe_tower_extruder - 1);
sort_remove_duplicates(lt.extruders); sort_remove_duplicates(lt.extruders);
changed = true; changed = true;
} }
} }
// Now convert the 0-based list to 1-based again.
for (LayerTools& lt : m_layer_tools) {
for (auto& extruder : lt.extruders)
++extruder;
}
} }
return changed; return changed;
} }