1
0

There's no "round" function in MSVC2008.

This commit is contained in:
madmaxoft 2014-05-18 22:49:27 +02:00
parent e09a04a23a
commit a651c865e4
2 changed files with 4 additions and 4 deletions

View File

@ -321,7 +321,7 @@ bool cEntity::DoTakeDamage(TakeDamageInfo & a_TDI)
m_World->BroadcastEntityAnimation(*this, 4); // Critical hit m_World->BroadcastEntityAnimation(*this, 4); // Critical hit
} }
Player->GetStatManager().AddValue(statDamageDealt, round(a_TDI.FinalDamage * 10)); Player->GetStatManager().AddValue(statDamageDealt, (StatValue)floor(a_TDI.FinalDamage * 10 + 0.5));
} }
m_Health -= (short)a_TDI.FinalDamage; m_Health -= (short)a_TDI.FinalDamage;

View File

@ -838,7 +838,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
AddFoodExhaustion(0.3f); AddFoodExhaustion(0.3f);
SendHealth(); SendHealth();
m_Stats.AddValue(statDamageTaken, round(a_TDI.FinalDamage * 10)); m_Stats.AddValue(statDamageTaken, (StatValue)floor(a_TDI.FinalDamage * 10 + 0.5));
return true; return true;
} }
return false; return false;
@ -1953,7 +1953,7 @@ void cPlayer::HandleFloater()
void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos) void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos)
{ {
StatValue Value = round(a_DeltaPos.Length() * 100); StatValue Value = (StatValue)floor(a_DeltaPos.Length() * 100 + 0.5);
if (m_AttachedTo == NULL) if (m_AttachedTo == NULL)
{ {
@ -1970,7 +1970,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos)
if ((Block == E_BLOCK_LADDER) && (a_DeltaPos.y > 0.0)) // Going up if ((Block == E_BLOCK_LADDER) && (a_DeltaPos.y > 0.0)) // Going up
{ {
m_Stats.AddValue(statDistClimbed, round(a_DeltaPos.y * 100)); m_Stats.AddValue(statDistClimbed, (StatValue)floor(a_DeltaPos.y * 100 + 0.5));
} }
else else
{ {