Updated IsDroidInRange routine to correctly calculate whether a droid is in range