Fixed some bugs in GetPlayerDirection()