Bugfix: extruder indices mismatch when using specific extruder for the wipe tower (followup of 2d6d37f, which was wrong)

This commit is contained in:
Lukas Matena 2023-07-12 13:40:55 +02:00
parent 4092da7aef
commit 917ae80cc2

View File

@ -169,6 +169,11 @@ ToolOrdering::ToolOrdering(const Print &print, unsigned int first_extruder, bool
this->fill_wipe_tower_partitions(print.config(), object_bottom_z, max_layer_height);
if (this->insert_wipe_tower_extruder()) {
// Now convert the 0-based list to 1-based again, because that is what reorder_extruder expects.
for (LayerTools& lt : m_layer_tools) {
for (auto& extruder : lt.extruders)
++extruder;
}
this->reorder_extruders(first_extruder);
this->fill_wipe_tower_partitions(print.config(), object_bottom_z, max_layer_height);
}
@ -478,12 +483,7 @@ bool ToolOrdering::insert_wipe_tower_extruder()
sort_remove_duplicates(lt.extruders);
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;
}