Core/Objects: Fixed HasInLine and IsInBetween checks on certain compilers

This commit is contained in:
Shauren
2011-02-15 17:09:46 +01:00
parent ad11baffe6
commit a24deaf980
2 changed files with 3 additions and 3 deletions
+2 -2
View File
@@ -1145,7 +1145,7 @@ bool Position::HasInLine(const Unit * const target, float distance, float width)
return false;
width += target->GetObjectSize();
float angle = GetRelativeAngle(target);
return abs(sin(angle)) * GetExactDist2d(target->GetPositionX(), target->GetPositionY()) < width;
return fabs(sin(angle)) * GetExactDist2d(target->GetPositionX(), target->GetPositionY()) < width;
}
std::string Position::ToString() const
@@ -1532,7 +1532,7 @@ bool WorldObject::IsInBetween(const WorldObject *obj1, const WorldObject *obj2,
size = GetObjectSize() / 2;
float angle = obj1->GetAngle(this) - obj1->GetAngle(obj2);
return abs(sin(angle)) * GetExactDist2d(obj1->GetPositionX(), obj1->GetPositionY()) < size;
return fabs(sin(angle)) * GetExactDist2d(obj1->GetPositionX(), obj1->GetPositionY()) < size;
}
bool WorldObject::isInFront(WorldObject const* target, float distance, float arc) const
+1 -1
View File
@@ -2316,7 +2316,7 @@ void Player::Regenerate(Powers power)
return;
addvalue += m_powerFraction[power];
uint32 integerValue = uint32(abs(addvalue));
uint32 integerValue = uint32(fabs(addvalue));
if (addvalue < 0.0f)
{