Fix of issue 1368 (vector index out of bounds in the wipe tower generator)

This commit is contained in:
Lukas Matena 2018-10-29 13:29:10 +01:00
parent 720fb29768
commit f2836d4738

View File

@ -643,6 +643,7 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::tool_change(unsigned int tool, boo
"\n\n");
// Ask our writer about how much material was consumed:
if (m_current_tool < m_used_filament_length.size())
m_used_filament_length[m_current_tool] += writer.get_and_reset_used_filament_length();
ToolChangeResult result;
@ -1068,7 +1069,8 @@ WipeTower::ToolChangeResult WipeTowerPrusaMM::finish_layer()
m_depth_traversed = m_wipe_tower_depth-m_perimeter_width;
// Ask our writer about how much material was consumed:
// Ask our writer about how much material was consumed.
if (m_current_tool < m_used_filament_length.size())
m_used_filament_length[m_current_tool] += writer.get_and_reset_used_filament_length();
ToolChangeResult result;
@ -1166,7 +1168,6 @@ void WipeTowerPrusaMM::save_on_last_wipe()
}
}
// Processes vector m_plan and calls respective functions to generate G-code for the wipe tower
// Resulting ToolChangeResults are appended into vector "result"
void WipeTowerPrusaMM::generate(std::vector<std::vector<WipeTower::ToolChangeResult>> &result)
@ -1256,6 +1257,4 @@ void WipeTowerPrusaMM::make_wipe_tower_square()
lay.extra_spacing = lay.depth / lay.toolchanges_depth();
}
}; // namespace Slic3r