Handle door navigation and turnarounds
This commit is contained in:
+7
-1
@@ -125,7 +125,13 @@ class Pathfinder(AStar):
|
||||
|
||||
@functools.lru_cache(maxsize=BLOCK_CACHE_SIZE)
|
||||
def bair(self, p):
|
||||
return self.chunks.get_block_at(*p) in blocks.NON_SOLID_IDS
|
||||
state_id = self.chunks.get_block_at(*p)
|
||||
if state_id in blocks.DOOR_IDS:
|
||||
if blocks.PROPS.get(state_id, {}).get('open') == 'true':
|
||||
return True
|
||||
if state_id in blocks.OPENABLE_DOOR_IDS:
|
||||
return tuple(p) not in self.g.get('unopenable_doors', set())
|
||||
return state_id in blocks.NON_SOLID_IDS
|
||||
|
||||
@functools.lru_cache(maxsize=BLOCK_CACHE_SIZE)
|
||||
def bavoid(self, p):
|
||||
|
||||
Reference in New Issue
Block a user