Fixed friction being applied whilst airborne
Reported by tonibm9 in #1300.
This commit is contained in:
parent
c0a069b260
commit
4019847857
@ -941,19 +941,21 @@ void cEntity::HandlePhysics(float a_Dt, cChunk & a_Chunk)
|
|||||||
}
|
}
|
||||||
NextSpeed.y += fallspeed;
|
NextSpeed.y += fallspeed;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
// Friction
|
|
||||||
if (NextSpeed.SqrLength() > 0.0004f)
|
|
||||||
{
|
{
|
||||||
NextSpeed.x *= 0.7f / (1 + a_Dt);
|
// Friction on ground
|
||||||
if (fabs(NextSpeed.x) < 0.05)
|
if (NextSpeed.SqrLength() > 0.0004f)
|
||||||
{
|
{
|
||||||
NextSpeed.x = 0;
|
NextSpeed.x *= 0.7f / (1 + a_Dt);
|
||||||
}
|
if (fabs(NextSpeed.x) < 0.05)
|
||||||
NextSpeed.z *= 0.7f / (1 + a_Dt);
|
{
|
||||||
if (fabs(NextSpeed.z) < 0.05)
|
NextSpeed.x = 0;
|
||||||
{
|
}
|
||||||
NextSpeed.z = 0;
|
NextSpeed.z *= 0.7f / (1 + a_Dt);
|
||||||
|
if (fabs(NextSpeed.z) < 0.05)
|
||||||
|
{
|
||||||
|
NextSpeed.z = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user