Prev Previous Post   Next Post Next
Old 04-25-2011, 03:23 AM
delirius delirius is offline
Join Date: Feb 2010
Posts: 132

function onList looks ok to me.

Check your function passable. Especially first line of code there.
and game.mapList[gridToIndex(x, y)] == 0

Next i thin i found logical error in function findPath.
You always add node to list, even if it already is on.

local onOpenList = onList(openList, focusNode.x + u, focusNode.y + v);
if onOpenList == false then
else--already on openList; check if this is a better path
table.insert(openList, node);
<---- this could be it!!!
Reply With Quote


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 07:53 AM.