refactor(Core/Misc): ceil() to std::ceil() (#9791)

- prefer std functions over C functions
This commit is contained in:
Kitzunu
2022-01-03 14:11:39 +01:00
committed by GitHub
parent 61649b7e6d
commit f04709a326
8 changed files with 13 additions and 13 deletions

View File

@@ -891,7 +891,7 @@ bool BfCapturePoint::HandlePlayerEnter(Player* player)
if (GameObject* go = GetCapturePointGo(player))
{
player->SendUpdateWorldState(go->GetGOInfo()->capturePoint.worldState1, 1);
player->SendUpdateWorldState(go->GetGOInfo()->capturePoint.worldstate2, uint32(ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f)));
player->SendUpdateWorldState(go->GetGOInfo()->capturePoint.worldstate2, uint32(std::ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f)));
player->SendUpdateWorldState(go->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct);
}
return m_activePlayers[player->GetTeamId()].insert(player->GetGUID()).second;
@@ -924,7 +924,7 @@ void BfCapturePoint::SendChangePhase()
// send this too, sometimes the slider disappears, dunno why :(
player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldState1, 1);
// send these updates to only the ones in this objective
player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate2, (uint32) ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f));
player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate2, (uint32) std::ceil((m_value + m_maxValue) / (2 * m_maxValue) * 100.0f));
// send this too, sometimes it resets :S
player->SendUpdateWorldState(capturePoint->GetGOInfo()->capturePoint.worldstate3, m_neutralValuePct);
}