fix some melee targetting stuff.

change VectorToDirection to be a static member of Pathfinding.cpp, just
like it's cousin, DirectionToVector.

change the ValidMeleeRange check to actually trace a trajectory rather
than checking the pathfinding validity.

adjust said method to actually account for stairs and ramps properly,
and get rid of the "-1" case