Only loop over particles that are within range and active. Removed if statement that should never be true.