diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp index 28baa4047d..cf104e7b5a 100644 --- a/Marlin/src/module/tool_change.cpp +++ b/Marlin/src/module/tool_change.cpp @@ -45,8 +45,8 @@ #endif #endif -#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0) - #include "../gcode/gcode.h" // for dwell() +#if ENABLED(MAGNETIC_PARKING_EXTRUDER) || defined(EVENT_GCODE_AFTER_TOOLCHANGE) || (ENABLED(PARKING_EXTRUDER) && PARKING_EXTRUDER_SOLENOIDS_DELAY > 0) + #include "../gcode/gcode.h" #endif #if ANY(SWITCHING_EXTRUDER, SWITCHING_NOZZLE, SWITCHING_TOOLHEAD) @@ -861,7 +861,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { } #endif // TOOLCHANGE_FILAMENT_SWAP - #if HAS_LEVELING + #if HAS_LEVELING && DISABLED(SINGLENOZZLE) // Set current position to the physical position TEMPORARY_BED_LEVELING_STATE(false); #endif @@ -1068,7 +1068,8 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) { #endif #ifdef EVENT_GCODE_AFTER_TOOLCHANGE - gcode.process_subcommands_now_P(EVENT_GCODE_AFTER_TOOLCHANGE); + if (!no_move) + gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_AFTER_TOOLCHANGE)); #endif SERIAL_ECHO_START();