fixed bug in physics get distance; added range requirement to player AI cast