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.
This commit is contained in:
Arjen Hiemstra 2017-03-28 17:44:29 +02:00
parent 4005f5082b
commit 4cea1b6d33

View file

@ -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)