summaryrefslogtreecommitdiffstats
path: root/src/Entities/Player.cpp
diff options
context:
space:
mode:
authormadmaxoft <github@xoft.cz>2014-05-18 22:49:27 +0200
committermadmaxoft <github@xoft.cz>2014-05-18 22:49:27 +0200
commita651c865e40ad80b52ddf69004b40a580e7069ea (patch)
treeac379cd96e56c7a3478f4b90b4b7c0dd01cca89c /src/Entities/Player.cpp
parentFixed datatype truncation in Diff() template. (diff)
downloadcuberite-a651c865e40ad80b52ddf69004b40a580e7069ea.tar
cuberite-a651c865e40ad80b52ddf69004b40a580e7069ea.tar.gz
cuberite-a651c865e40ad80b52ddf69004b40a580e7069ea.tar.bz2
cuberite-a651c865e40ad80b52ddf69004b40a580e7069ea.tar.lz
cuberite-a651c865e40ad80b52ddf69004b40a580e7069ea.tar.xz
cuberite-a651c865e40ad80b52ddf69004b40a580e7069ea.tar.zst
cuberite-a651c865e40ad80b52ddf69004b40a580e7069ea.zip
Diffstat (limited to 'src/Entities/Player.cpp')
-rw-r--r--src/Entities/Player.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/Entities/Player.cpp b/src/Entities/Player.cpp
index 632c41936..c3b763278 100644
--- a/src/Entities/Player.cpp
+++ b/src/Entities/Player.cpp
@@ -838,7 +838,7 @@ bool cPlayer::DoTakeDamage(TakeDamageInfo & a_TDI)
AddFoodExhaustion(0.3f);
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 false;
@@ -1953,7 +1953,7 @@ void cPlayer::HandleFloater()
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)
{
@@ -1970,7 +1970,7 @@ void cPlayer::UpdateMovementStats(const Vector3d & a_DeltaPos)
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
{