diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-17 21:19:12 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-17 21:19:12 +0200 |
commit | 558cc1bf26edff485e4673f5db7158970445dda7 (patch) | |
tree | 6e4df23d15000c4b154ed9667e0b51801f4ca7cd /source/Entities | |
parent | Merge pull request #171 from tonibm19/patch-5 (diff) | |
parent | Fixed derpy comparison (diff) | |
download | cuberite-558cc1bf26edff485e4673f5db7158970445dda7.tar cuberite-558cc1bf26edff485e4673f5db7158970445dda7.tar.gz cuberite-558cc1bf26edff485e4673f5db7158970445dda7.tar.bz2 cuberite-558cc1bf26edff485e4673f5db7158970445dda7.tar.lz cuberite-558cc1bf26edff485e4673f5db7158970445dda7.tar.xz cuberite-558cc1bf26edff485e4673f5db7158970445dda7.tar.zst cuberite-558cc1bf26edff485e4673f5db7158970445dda7.zip |
Diffstat (limited to 'source/Entities')
-rw-r--r-- | source/Entities/Entity.cpp | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/source/Entities/Entity.cpp b/source/Entities/Entity.cpp index d9272b39d..dc3c7796e 100644 --- a/source/Entities/Entity.cpp +++ b/source/Entities/Entity.cpp @@ -651,21 +651,21 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk) } } } - else + } + else + { + // Friction for non-minecarts + if (NextSpeed.SqrLength() > 0.0004f) { - // Friction - if (NextSpeed.SqrLength() > 0.0004f) + NextSpeed.x *= 0.7f / (1 + a_Dt); + if (fabs(NextSpeed.x) < 0.05) { - 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; - } + NextSpeed.x = 0; + } + NextSpeed.z *= 0.7f / (1 + a_Dt); + if (fabs(NextSpeed.z) < 0.05) + { + NextSpeed.z = 0; } } } |