1
0
mirror of https://github.com/vcmi/vcmi.git synced 2025-06-15 00:05:02 +02:00

int3 dist2d microoptimization

This commit is contained in:
karol57
2014-05-25 20:42:25 +02:00
parent df8cce0d61
commit dd33fd51a8
5 changed files with 18 additions and 17 deletions

View File

@ -424,7 +424,7 @@ const CGObjectInstance * CMap::getObjectiveObjectFrom(int3 pos, Obj::EObj type)
bestMatch = object;
else
{
if (object->pos.dist2d(pos) < bestMatch->pos.dist2d(pos))
if (object->pos.dist2dSQ(pos) < bestMatch->pos.dist2dSQ(pos))
bestMatch = object;// closer than one we already found
}
}