summaryrefslogtreecommitdiffstats
path: root/src/Entities
diff options
context:
space:
mode:
Diffstat (limited to 'src/Entities')
-rw-r--r--src/Entities/Entity.cpp24
1 files changed, 13 insertions, 11 deletions
diff --git a/src/Entities/Entity.cpp b/src/Entities/Entity.cpp
index fba688847..2d2a75a75 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;
+ }
}
}