Check this out if you are into pathfinding, has a lot of code:

http://www.pascalgamedevelopment.com...?t=910&start=0