Skip to content

Commit

Permalink
取消判断当前结点能否通过
Browse files Browse the repository at this point in the history
  • Loading branch information
YYRise authored Oct 13, 2019
1 parent 6e65999 commit 9b50ae8
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions jps.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,8 +102,8 @@ def jump_node(self, now, pre):
if now == self.e_pos:
return now

# if self.is_pass(now[0], now[1]) is False:
# return None
if self.is_pass(now[0], now[1]) is False:
return None
if dir[0] != 0 and dir[1] != 0:
# 左下能走且左不能走,或右上能走且上不能走
if (self.is_pass(now[0] - dir[0], now[1] + dir[1]) and not self.is_pass(now[0]-dir[0], now[1])) or (self.is_pass(now[0] + dir[0], now[1] - dir[1]) and not self.is_pass(now[0], now[1]-dir[1])):
Expand Down Expand Up @@ -292,4 +292,4 @@ def check_pos_valid(x, y):
if __name__ == "__main__":
# tilemap.tile_manager.load("../maps/")
# find_path(MAP_CONFIG_NAME, 23, 19, 25, 19)
find_path([0, 0], [1, 3])
find_path([0, 0], [1, 3])

0 comments on commit 9b50ae8

Please sign in to comment.