From 4cea1b6d33500ed834de1643550d500a5ecb30b6 Mon Sep 17 00:00:00 2001 From: Arjen Hiemstra Date: Tue, 28 Mar 2017 17:44:29 +0200 Subject: [PATCH] Fix error case in addExtruder Error out when the new size is going to be more than extruderCount instead of whether it currently is more than extruderCount. --- cura/Settings/GlobalStack.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/cura/Settings/GlobalStack.py b/cura/Settings/GlobalStack.py index ec3a2c05fd..0b46c53da1 100644 --- a/cura/Settings/GlobalStack.py +++ b/cura/Settings/GlobalStack.py @@ -113,7 +113,7 @@ class GlobalStack(ContainerStack): def addExtruder(self, extruder): extruder_count = self.getProperty("machine_extruder_count", "value") - if len(self._extruders) > extruder_count: + if len(self._extruders) + 1 > extruder_count: raise Exceptions.TooManyExtrudersError("Tried to add extruder to {id} but its extruder count is {count}".format(id = self.id, count = extruder_count)) self._extruders.append(extruder)