mirror of
https://github.com/ElCeejo/creatura.git
synced 2025-04-30 13:51:41 -04:00
Fix crash in pathfinder
We need to save `self._path_data` before any return. Otherwise old data will cause crashes, for example because `self._path_data.count` > `openSet` size.
This commit is contained in:
parent
de5ddbd4c1
commit
934fb37aef
1 changed files with 1 additions and 1 deletions
|
@ -296,7 +296,7 @@ function creatura.find_lvm_path(self, start, goal, obj_width, obj_height, max_op
|
|||
fail_safe = fail_safe + 1
|
||||
end
|
||||
repeat
|
||||
if not closedSet[current_id] then return end
|
||||
if not closedSet[current_id] then self._path_data = {} return end
|
||||
table.insert(path, closedSet[current_id].pos)
|
||||
current_id = closedSet[current_id].parent
|
||||
until current_id == start_index or #path >= fail_safe
|
||||
|
|
Loading…
Add table
Reference in a new issue