diff --git a/lokbot/farmer.py b/lokbot/farmer.py index dafa7703..3bcd81c0 100644 --- a/lokbot/farmer.py +++ b/lokbot/farmer.py @@ -1025,15 +1025,15 @@ def _total_troops_capacity_according_to_resources(self, troop_code): """ req_resources = TRAIN_TROOP_RESOURCE_REQUIREMENT[troop_code] - amount = 0 + amount = None for req_resource, resource in zip(req_resources, self.resources): if req_resource == 0: continue - if amount == 0 or resource // req_resource <= amount: + if amount is None or resource // req_resource <= amount: amount = resource // req_resource - return amount + return amount if amount is not None else 0 def _random_choice_building(self, building_code): """