diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index 8ca6d3d62..35c6d6041 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -222,11 +222,10 @@ void AvoidCrossingPerimeters::init_external_mp(const Print &print) std::string(); } - int - OozePrevention::_get_temp(GCode& gcodegen) + int OozePrevention::_get_temp(GCode& gcodegen) { if (gcodegen.writer().tool_is_extruder()) - return (gcodegen.layer() != NULL && gcodegen.layer()->id() == 0) + return (gcodegen.layer() == NULL || gcodegen.layer()->id() == 0) ? gcodegen.config().first_layer_temperature.get_at(gcodegen.writer().tool()->id()) : gcodegen.config().temperature.get_at(gcodegen.writer().tool()->id()); else @@ -1933,7 +1932,7 @@ static bool custom_gcode_sets_temperature(const std::string &gcode, const int mc } } } - } + } // Skip the rest of the line. for (; *ptr != 0 && *ptr != '\r' && *ptr != '\n'; ++ ptr); // Skip the end of line indicators. diff --git a/src/libslic3r/GCodeWriter.cpp b/src/libslic3r/GCodeWriter.cpp index afe04b21a..3fc5ee9e7 100644 --- a/src/libslic3r/GCodeWriter.cpp +++ b/src/libslic3r/GCodeWriter.cpp @@ -166,12 +166,8 @@ std::string GCodeWriter::set_temperature(const unsigned int temperature, bool wa } gcode << temp_w_offset; bool multiple_tools = this->multiple_extruders && ! m_single_extruder_multi_material; - if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)) ) { - if (FLAVOR_IS(gcfRepRap)) { - gcode << " P" << tool; - } else { - gcode << " T" << tool; - } + if (tool != -1 && (multiple_tools || FLAVOR_IS(gcfMakerWare) || FLAVOR_IS(gcfSailfish)) && FLAVOR_IS_NOT(gcfRepRap)) { + gcode << " T" << tool; } gcode << " ; " << comment << "\n";