mirror of
https://github.com/vcmi/vcmi.git
synced 2025-05-31 22:59:54 +02:00
Fix std::abs warning
Recent clang wants std::abs instead of plain abs
This commit is contained in:
parent
e4b1ef1405
commit
d24fd10e21
@ -432,7 +432,7 @@ bool boundaryBetweenTwoPoints (int3 pos1, int3 pos2, CCallback * cbp) //determin
|
||||
for (int y = yMin; y <= yMax; ++y)
|
||||
{
|
||||
int3 tile = int3(x, y, pos1.z); //use only on same level, ofc
|
||||
if (abs(pos1.dist2d(tile) - pos2.dist2d(tile)) < 1.5)
|
||||
if (std::abs(pos1.dist2d(tile) - pos2.dist2d(tile)) < 1.5)
|
||||
{
|
||||
if (!(cbp->isVisible(tile) && cbp->getTile(tile)->blocked)) //if there's invisible or unblocked tile between, it's good
|
||||
return false;
|
||||
@ -509,4 +509,4 @@ bool compareArtifacts(const CArtifactInstance *a1, const CArtifactInstance *a2)
|
||||
return true;
|
||||
else
|
||||
return art1->price > art2->price;
|
||||
}
|
||||
}
|
||||
|
@ -782,7 +782,7 @@ bool CShootingAnimation::init()
|
||||
spi.catapultInfo.reset(new CatapultProjectileInfo(Point(spi.x, spi.y), destPos));
|
||||
|
||||
double animSpeed = AnimationControls::getProjectileSpeed() / 10;
|
||||
spi.lastStep = abs((destPos.x - spi.x) / animSpeed);
|
||||
spi.lastStep = std::abs((destPos.x - spi.x) / animSpeed);
|
||||
spi.dx = animSpeed;
|
||||
spi.dy = 0;
|
||||
|
||||
|
@ -113,7 +113,7 @@ template<typename IntType>
|
||||
std::string makeNumberShort(IntType number, IntType maxLength = 3) //the output is a string containing at most 5 characters [4 if positive] (eg. intead 10000 it gives 10k)
|
||||
{
|
||||
IntType max = pow(10, maxLength);
|
||||
if (abs(number) < max)
|
||||
if (std::abs(number) < max)
|
||||
return boost::lexical_cast<std::string>(number);
|
||||
|
||||
std::string symbols = " kMGTPE";
|
||||
|
Loading…
x
Reference in New Issue
Block a user