From 1d5cc1b6bde5fea5c12afbf2a1ac41b71a33f6fb Mon Sep 17 00:00:00 2001 From: Charlie Powell <31997505+cp2004@users.noreply.github.com> Date: Tue, 9 Aug 2022 19:50:47 +0100 Subject: [PATCH] :bug: Fix errors including @ commands in macros that weren't this plugin's --- octoprint_gcode_macro/__init__.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/octoprint_gcode_macro/__init__.py b/octoprint_gcode_macro/__init__.py index d374ebe..5a5b35a 100644 --- a/octoprint_gcode_macro/__init__.py +++ b/octoprint_gcode_macro/__init__.py @@ -109,7 +109,9 @@ def render_macro(self, command, level=0): for cmd in commands: if cmd.startswith("@"): # Recursively render for each @ command in macro - result += self.render_macro(cmd, level=level + 1) + submacro = self.render_macro(cmd, level=level + 1) + if submacro: + result += submacro else: result += [cmd] else: