Slightly better pathfinding

Improved pathfinding. It will now check if it can move in x or y instead
of just trying one and failing if it can't. It now fails when it gets to
the bottom of the room because it can't figure out how to get around the
corner/through the door of the room into the other room.