FIX: Unnecessary prime tower error prompts

Custom gcode on other plate causes unnecessary prime tower error prompts
Jira: 6305

Change-Id: If499659b364a6b6898db1587b7b2aeed03758667
This commit is contained in:
zhimin.zeng 2024-02-20 17:12:59 +08:00 committed by Lane.Wei
parent 6036c0fc0a
commit 698e1ae63c

View File

@ -400,8 +400,8 @@ std::vector<unsigned int> Print::extruders(bool conside_custom_gcode) const
if (conside_custom_gcode) {
//BBS
int num_extruders = m_config.filament_colour.size();
for (auto plate_data : m_model.plates_custom_gcodes) {
for (auto item : plate_data.second.gcodes) {
if (m_model.plates_custom_gcodes.find(m_model.curr_plate_index) != m_model.plates_custom_gcodes.end()) {
for (auto item : m_model.plates_custom_gcodes.at(m_model.curr_plate_index).gcodes) {
if (item.type == CustomGCode::Type::ToolChange && item.extruder <= num_extruders)
extruders.push_back((unsigned int)(item.extruder - 1));
}