Apply sign work zones before candidate routing
This commit is contained in:
@@ -30,10 +30,11 @@ class GatherWoodStates:
|
||||
w = self.g.world
|
||||
p = utils.pint(self.g.pos)
|
||||
|
||||
for tree in w.find_trees(p, 100):
|
||||
print('Found tree:', tree)
|
||||
trees = w.filter_work_positions(w.find_trees(p, 100))
|
||||
for tree in trees:
|
||||
if tree in self.bad_trees:
|
||||
continue
|
||||
print('Found tree:', tree)
|
||||
tree_type = blocks.BLOCKS[w.block_at(*tree)].replace('_log', '')
|
||||
if items.get_sapling_id(tree_type) is None:
|
||||
print('No plantable sapling for', tree_type, '- skipping')
|
||||
@@ -53,7 +54,10 @@ class GatherWoodStates:
|
||||
|
||||
def find_openings(self):
|
||||
w = self.g.world
|
||||
self.openings = w.find_tree_openings(self.tree)
|
||||
self.openings = [
|
||||
opening for opening in w.find_tree_openings(self.tree)
|
||||
if w.work_position_allowed(opening)
|
||||
]
|
||||
self.state = self.choose_opening
|
||||
|
||||
def choose_opening(self):
|
||||
|
||||
Reference in New Issue
Block a user