Bound retries for unreachable path recovery
This commit is contained in:
1 parent
d4eae5ee5f
commit
7ab354800b
4 files changed
+71
-6
No files matched your search
@@ -352,6 +352,23 @@ class GrabSuppliesStates(WorkBoundaryReturnMixin):
|
||||
self.state = self.check_supplies
|
||||
|
||||
def going_to_ground_item(self):
|
||||
failed_target = self.g.get('navigation_failed_target')
|
||||
if (failed_target is not None and self.ground_position is not None and
|
||||
tuple(failed_target) == tuple(self.ground_position)):
|
||||
obj = self.g.objects.get(self.ground_entity_id)
|
||||
label = (self._item_label(obj.item_id) if obj is not None
|
||||
else 'item')
|
||||
print('No reachable path to ground {} at {}; skipping'.format(
|
||||
label, self.ground_position), flush=True)
|
||||
if self.ground_entity_id is not None:
|
||||
self.checked_ground_items.add(self.ground_entity_id)
|
||||
self.g.navigation_failed_target = None
|
||||
self.g.path = []
|
||||
self.ground_entity_id = None
|
||||
self.ground_position = None
|
||||
self.state = self.find_ground_items
|
||||
return
|
||||
|
||||
obj = self.g.objects.get(self.ground_entity_id)
|
||||
have_enough = (self.g.game.count_items(self.target_items) >=
|
||||
self.ground_required_count)
|
||||
|
||||
Reference in new issue
Block a user