diff --git a/src/libslic3r/GCode.cpp b/src/libslic3r/GCode.cpp index cd8319869..97da766c9 100644 --- a/src/libslic3r/GCode.cpp +++ b/src/libslic3r/GCode.cpp @@ -65,17 +65,16 @@ static bool custom_gcode_changes_tool(const std::string& custom_gcode, const std // only whitespace is allowed before the command while (--pos < custom_gcode.size() && custom_gcode[pos] != '\n') { if (! std::isspace(custom_gcode[pos])) - continue; + goto NEXT; } - // we should also check that the extruder changes to what was expected - std::istringstream ss(custom_gcode.substr(from_pos, std::string::npos)); - unsigned num = 0; - if (ss >> num) { - if (num == next_extruder) - ok = true; - else - ok = false; + { + // we should also check that the extruder changes to what was expected + std::istringstream ss(custom_gcode.substr(from_pos, std::string::npos)); + unsigned num = 0; + if (ss >> num) + ok = (num == next_extruder); } +NEXT: ; } return ok; } diff --git a/src/libslic3r/PrintConfig.cpp b/src/libslic3r/PrintConfig.cpp index 6ea94726d..89fdc4f26 100644 --- a/src/libslic3r/PrintConfig.cpp +++ b/src/libslic3r/PrintConfig.cpp @@ -2054,10 +2054,10 @@ void PrintConfigDef::init_fff_params() def = this->add("toolchange_gcode", coString); def->label = L("Tool change G-code"); - def->tooltip = L("This custom code is inserted before every toolchange. You can use placeholder variables for all Slic3r settings " - "as well as {previous_extruder} and {next_extruder}. If you explicitely include tool-changing command (such as T{next_extruder}), " - "which changes to the correct extruder, no other such command will be emitted. This allows you to do custom stuff " - "both before and after the toolchange."); + def->tooltip = L("This custom code is inserted before every toolchange. You can use placeholder variables for all PrusaSlicer settings " + "as well as {previous_extruder} and {next_extruder}. Explicitely including a tool-changing command (such as T{next_extruder}), " + "which changes to the correct extruder, no other such command will be emitted. It is therefore possible to script custom " + "behaviour both before and after the toolchange."); def->multiline = true; def->full_width = true; def->height = 5;