From 53939796a653d99961fff05f32be275ef05e01ce Mon Sep 17 00:00:00 2001 From: Lukas Matena Date: Tue, 20 Aug 2019 14:22:31 +0200 Subject: [PATCH] GCode.cpp: Fix of temperature change before print Function set_extruder can be called before moving to the first layer, m_layer_index is then -1. We definitely don't want to set temperature for second layer in that case. --- src/libslic3r/GCode.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 7a6f686dfc..433167e895 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -2887,7 +2887,7 @@ std::string GCode::set_extruder(unsigned int extruder_id, double print_z) // Set the temperature if the wipe tower didn't (not needed for non-single extruder MM) if (m_config.single_extruder_multi_material && !m_config.wipe_tower) { - int temp = (m_layer_index == 0 ? m_config.first_layer_temperature.get_at(extruder_id) : + int temp = (m_layer_index <= 0 ? m_config.first_layer_temperature.get_at(extruder_id) : m_config.temperature.get_at(extruder_id)); gcode += m_writer.set_temperature(temp, false);