1
0
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:
Ivan Savenko 2023-09-30 22:01:39 +03:00
parent c0a31b716a
commit f3ed589e35
3 changed files with 3 additions and 3 deletions

View File

@ -49,7 +49,7 @@
}, },
"secondary" : { "secondary" : {
"@gainedSkill" : 1 "@gainedSkill" : 1
} },
"message" : 171 // Witch teaches you skill "message" : 171 // Witch teaches you skill
} }
], ],

View File

@ -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)
{ {

View File

@ -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: