Skip to content

Commit 3344264

Browse files
authored
Merge pull request #258 from 0ttoman/my-branch
checking array length beforehand
2 parents 840777a + d09cc6a commit 3344264

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

2d/navigation_astar/character.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ func _ready():
1818
func _change_state(new_state):
1919
if new_state == FOLLOW:
2020
path = get_parent().get_node('TileMap').get_path(position, target_position)
21-
if not path:
21+
if not path or len(path) == 1:
2222
_change_state(IDLE)
2323
return
2424
# The index 0 is the starting cell

0 commit comments

Comments
 (0)