int Find_nearest_inf_ship(ref chr)
{
ref rGroup;
ref pchar = GetMainCharacter();
string groupname;
float visibility_range = 3000.0; // maximal visibility range
int i;
ref achr;
int achridx;
int place = -1;
float enemydist;
enemydist = 0.0;
float memoire=0.0;
if(CheckAttribute(chr,"runaway")){DeleteAttribute(chr,"runaway");}
//logit("FOG Weathers.Fog.SeaDensity : " + Weathers.Fog.SeaDensity + " !");
// visibility_range = (2.6/stf(Weathers.Fog.SeaDensity));
visibility_range = visibility_range - (stf(Weathers.Fog.SeaDensity) * 130 * visibility_range);
// more a character have leadership and sailing skills and more he can see far
// TODO: Aconcagua: suppose we should use the effective value -> use GetCharacterSkill
// perhaps even GetSummonSkillFromName???
// compare BattleInterface.c
//visibility_range = visibility_range + (stf(chr.skill.Leadership) * stf(chr.skill.sailing)*5);
visibility_range = visibility_range + (GetCharacterSkill(chr, SKILL_LEADERSHIP) * GetCharacterSkill(chr, SKILL_SAILING) * 5);
if(Whr_IsNight()){visibility_range = visibility_range / 2;}
//logit("Visibility range : " + visibility_range + " !");