Fixed the infinite loop when finding next_position to move
Added sight range