Core/Objects: Fixed HasInLine and IsInBetween checks on certain compilers
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user