mirror of
https://github.com/vcmi/vcmi.git
synced 2025-03-19 21:10:12 +02:00
Use same fow radius calculation as in H3
This commit is contained in:
parent
c0a31b716a
commit
f3ed589e35
@ -49,7 +49,7 @@
|
||||
},
|
||||
"secondary" : {
|
||||
"@gainedSkill" : 1
|
||||
}
|
||||
},
|
||||
"message" : 171 // Witch teaches you skill
|
||||
}
|
||||
],
|
||||
|
@ -97,7 +97,7 @@ void CPrivilegedInfoCallback::getTilesInRange(std::unordered_set<int3> & tiles,
|
||||
for (int yd = std::max<int>(pos.y - radious, 0); yd <= std::min<int>(pos.y + radious, gs->map->height - 1); yd++)
|
||||
{
|
||||
int3 tilePos(xd,yd,pos.z);
|
||||
double distance = pos.dist(tilePos, distanceFormula);
|
||||
int distance = pos.dist(tilePos, distanceFormula);
|
||||
|
||||
if(distance <= radious)
|
||||
{
|
||||
|
@ -110,7 +110,7 @@ public:
|
||||
switch(formula)
|
||||
{
|
||||
case DIST_2D:
|
||||
return static_cast<ui32>(dist2d(o));
|
||||
return std::round(dist2d(o));
|
||||
case DIST_MANHATTAN:
|
||||
return static_cast<ui32>(mandist2d(o));
|
||||
case DIST_CHEBYSHEV:
|
||||
|
Loading…
x
Reference in New Issue
Block a user