diff options
author | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-16 20:19:25 +0200 |
---|---|---|
committer | Tiger Wang <ziwei.tiger@hotmail.co.uk> | 2013-09-16 20:19:25 +0200 |
commit | 9711fd797050d8956c10e5057287050022d085b6 (patch) | |
tree | eb444cb0634592488f7af9e684278e5870146f0b | |
parent | Torch fixes [SEE DESC] (diff) | |
download | cuberite-9711fd797050d8956c10e5057287050022d085b6.tar cuberite-9711fd797050d8956c10e5057287050022d085b6.tar.gz cuberite-9711fd797050d8956c10e5057287050022d085b6.tar.bz2 cuberite-9711fd797050d8956c10e5057287050022d085b6.tar.lz cuberite-9711fd797050d8956c10e5057287050022d085b6.tar.xz cuberite-9711fd797050d8956c10e5057287050022d085b6.tar.zst cuberite-9711fd797050d8956c10e5057287050022d085b6.zip |
Diffstat (limited to '')
-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; } } } |