mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 10:08:18 +00:00
Replace usages of atan2f
and atan2
with std::atan2
Another leftover from #6372.
This commit is contained in:
parent
1112c9e6b7
commit
58184c2d67
|
@ -1381,7 +1381,7 @@ void CHud::RenderMovementInformation(const int ClientID)
|
|||
{
|
||||
// On DDNet servers the more accurate angle is displayed, calculated from the target coordinates
|
||||
CNetObj_DDNetCharacter *pExtendedData = &m_pClient->m_Snap.m_aCharacters[ClientID].m_ExtendedData;
|
||||
Angle = atan2f(pExtendedData->m_TargetY, pExtendedData->m_TargetX);
|
||||
Angle = std::atan2(pExtendedData->m_TargetY, pExtendedData->m_TargetX);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
|
@ -160,7 +160,7 @@ void CCharacterCore::Tick(bool UseInput, bool DoDeferredTick)
|
|||
m_Direction = m_Input.m_Direction;
|
||||
|
||||
// setup angle
|
||||
float TmpAngle = atan2f(m_Input.m_TargetY, m_Input.m_TargetX);
|
||||
float TmpAngle = std::atan2(m_Input.m_TargetY, m_Input.m_TargetX);
|
||||
if(TmpAngle < -(pi / 2.0f))
|
||||
{
|
||||
m_Angle = (int)((TmpAngle + (2.0f * pi)) * 256.0f);
|
||||
|
|
|
@ -233,7 +233,7 @@ void CProjectile::Tick()
|
|||
}
|
||||
else if(m_Type == WEAPON_GUN)
|
||||
{
|
||||
GameServer()->CreateDamageInd(CurPos, -atan2(m_Direction.x, m_Direction.y), 10, (m_Owner != -1) ? TeamMask : CClientMask().set());
|
||||
GameServer()->CreateDamageInd(CurPos, -std::atan2(m_Direction.x, m_Direction.y), 10, (m_Owner != -1) ? TeamMask : CClientMask().set());
|
||||
m_MarkedForDestroy = true;
|
||||
return;
|
||||
}
|
||||
|
@ -380,7 +380,7 @@ bool CProjectile::FillExtraInfo(CNetObj_DDNetProjectile *pProj)
|
|||
return false;
|
||||
}
|
||||
//Send additional/modified info, by modifying the fields of the netobj
|
||||
float Angle = -atan2f(m_Direction.x, m_Direction.y);
|
||||
float Angle = -std::atan2(m_Direction.x, m_Direction.y);
|
||||
|
||||
int Data = 0;
|
||||
Data |= (absolute(m_Owner) & 255) << 0;
|
||||
|
|
Loading…
Reference in a new issue