For some reason it's not returning the path everytime. It only happens when there's a wall in between the player and the destination node. The path is only the start node and end node which makes the player walk right through the wall. But most of the time it works. Ha! Cannot figure it out!
Assuming you're doing this for learning purposes, and not reusing an existing piece of code... My best advice is to write some unit tests incrementally and check all your assumptions. I've found that unit tests provide amazing support for learning new algorithms, languages, and writing new code in general :-)
I realize you wanted someone to debug your program but well... ;-)
No no no. I didn't want any one o debug it for me, being this is just learning... just maybe thought someone could see something I couldn't after staring at the darn thing for awhile. But I did figure it out: