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