i'd put more brackets in there definately, but i guess it's doing what it should be anyway if you got this from a tutorial?

with
Quote:
while (paths[(my.start_node - 1) * 50 + (target_node - 1) * node_id * 50 + current_node] != 0)
it's impossible to see what's going on,

when doing calculations they aren't necessarily calculated from left to right, but in the order of *or/ then % then +or-

what you've written there (if i get this right) is...
while((paths[((my.start_node - 1) * 50) + ((target_node - 1) * node_id * 50) + current_node]) != 0)

which i'm not sure what you want but it's a lot easier to see... current_node is never multiplied, and i'm not sure why you're always muliplying my.start_node with 50,

if you're working off of a nodegrid you have no calculations there for both x and y axis

hope this helps a little but without seeing what you're trying to achieve it's hard to unravel what you're doing smile