diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-09-12 21:50:24 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2014-09-12 21:50:24 +0200 |
commit | 4019847857b7737be949904c545d904a98096441 (patch) | |
tree | 395d1e45fced57c70c6a2617b6ccfd8e57cfb993 /src/Entities/Entity.cpp | |
parent | APIDump: Improved command binding documentation. (diff) | |
download | cuberite-4019847857b7737be949904c545d904a98096441.tar cuberite-4019847857b7737be949904c545d904a98096441.tar.gz cuberite-4019847857b7737be949904c545d904a98096441.tar.bz2 cuberite-4019847857b7737be949904c545d904a98096441.tar.lz cuberite-4019847857b7737be949904c545d904a98096441.tar.xz cuberite-4019847857b7737be949904c545d904a98096441.tar.zst cuberite-4019847857b7737be949904c545d904a98096441.zip |
Diffstat (limited to 'src/Entities/Entity.cpp')
-rw-r--r-- | src/Entities/Entity.cpp | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp index 9bcdcffeb..6969501a3 100644 --- a/src/Entities/Entity.cpp +++ b/src/Entities/Entity.cpp @@ -941,19 +941,21 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk) } NextSpeed.y += fallspeed; } - - // Friction - if (NextSpeed.SqrLength() > 0.0004f) + else { - NextSpeed.x *= 0.7f / (1 + a_Dt); - if (fabs(NextSpeed.x) < 0.05) - { - NextSpeed.x = 0; - } - NextSpeed.z *= 0.7f / (1 + a_Dt); - if (fabs(NextSpeed.z) < 0.05) + // Friction on ground + if (NextSpeed.SqrLength() > 0.0004f) { - NextSpeed.z = 0; + NextSpeed.x *= 0.7f / (1 + a_Dt); + if (fabs(NextSpeed.x) < 0.05) + { + NextSpeed.x = 0; + } + NextSpeed.z *= 0.7f / (1 + a_Dt); + if (fabs(NextSpeed.z) < 0.05) + { + NextSpeed.z = 0; + } } } |