From d10e20d6d2faaea04df81dca682290a2aa081fee Mon Sep 17 00:00:00 2001
From: InsanityAutomation
 <38436470+InsanityAutomation@users.noreply.github.com>
Date: Fri, 15 Oct 2021 15:56:59 -0400
Subject: [PATCH] =?UTF-8?q?=E2=9C=A8=20Add=20option=20EVENT=5FGCODE=5FTOOL?=
 =?UTF-8?q?CHANGE=5FALWAYS=5FRUN=20(#22960)?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

---
 Marlin/Configuration_adv.h        | 1 +
 Marlin/src/module/tool_change.cpp | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/Marlin/Configuration_adv.h b/Marlin/Configuration_adv.h
index 6e44f009ed..86a7372ebd 100644
--- a/Marlin/Configuration_adv.h
+++ b/Marlin/Configuration_adv.h
@@ -2313,6 +2313,7 @@
    */
   //#define EVENT_GCODE_TOOLCHANGE_T0 "G28 A\nG1 A0" // Extra G-code to run while executing tool-change command T0
   //#define EVENT_GCODE_TOOLCHANGE_T1 "G1 A10"       // Extra G-code to run while executing tool-change command T1
+  //#define EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN        // Always execute above G-code sequences. Use with caution!
 
   /**
    * Tool Sensors detect when tools have been picked up or dropped.
diff --git a/Marlin/src/module/tool_change.cpp b/Marlin/src/module/tool_change.cpp
index cb551647d7..62889b6d5f 100644
--- a/Marlin/src/module/tool_change.cpp
+++ b/Marlin/src/module/tool_change.cpp
@@ -1307,7 +1307,7 @@ void tool_change(const uint8_t new_tool, bool no_move/*=false*/) {
 
     TERN_(HAS_FANMUX, fanmux_switch(active_extruder));
 
-    if (!no_move) {
+    if (ENABLED(EVENT_GCODE_TOOLCHANGE_ALWAYS_RUN) || !no_move) {
       #ifdef EVENT_GCODE_TOOLCHANGE_T0
         if (new_tool == 0)
           gcode.process_subcommands_now_P(PSTR(EVENT_GCODE_TOOLCHANGE_T0));