tomchapin / kocattackextra

KoCAttack Extra (Retired) - Official Project
0 stars 0 forks source link

Calculation of the distance in ShowViewAttacksDialog procedure is wrong #148

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
Hi !
I have found a error in the calculation of the distance at line 549. X axe is 
taken for both X and Y axes !

Please replace the line
var 
distance=t.CalcXYDist({'x':t.attacks[a].xy[0],'y':t.attacks[a].xy[0]},{'x':t.Get
CityCoordsX(t.attacks[a]['fromCity']),'y':t.GetCityCoordsX(t.attacks[a]['fromCit
y'])});
by this one :
var 
distance=t.CalcXYDist({'x':t.attacks[a].xy[0],'y':t.attacks[a].xy[1]},{'x':t.Get
CityCoordsX(t.attacks[a]['fromCity']),'y':t.GetCityCoordsY(t.attacks[a]['fromCit
y'])});

Thanks !
Regards.

Original issue reported on code.google.com by sylvain....@gmail.com on 11 Jan 2012 at 1:47