diff --git a/reborn.py b/reborn.py index 192f9c7..1f93ac5 100755 --- a/reborn.py +++ b/reborn.py @@ -272,11 +272,12 @@ try: for c in Client.near(Warehouse.get(0).pos): if d < Drone.len(): pack = c.pack() - for i in pack: - Drone.get(d).addTask('load', Warehouse.get(0), Product.get(i), 1) - for i in pack: - Drone.get(d).addTask('deliver', c, Product.get(i), 1) - d += 1 + if len(pack) == len(c.needs): + for i in pack: + Drone.get(d).addTask('load', Warehouse.get(0), Product.get(i), 1) + for i in pack: + Drone.get(d).addTask('deliver', c, Product.get(i), 1) + d += 1 while turn < SIMULATION: newTurn()