Fixed friction for entities
Due to a misplaced else, other entities weren't getting frictionmaster
parent
506a693339
commit
9711fd7970
|
@ -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
|
NextSpeed.x *= 0.7f / (1 + a_Dt);
|
||||||
if (NextSpeed.SqrLength() > 0.0004f)
|
if (fabs(NextSpeed.x) < 0.05)
|
||||||
{
|
{
|
||||||
NextSpeed.x *= 0.7f / (1 + a_Dt);
|
NextSpeed.x = 0;
|
||||||
if (fabs(NextSpeed.x) < 0.05)
|
}
|
||||||
{
|
NextSpeed.z *= 0.7f / (1 + a_Dt);
|
||||||
NextSpeed.x = 0;
|
if (fabs(NextSpeed.z) < 0.05)
|
||||||
}
|
{
|
||||||
NextSpeed.z *= 0.7f / (1 + a_Dt);
|
NextSpeed.z = 0;
|
||||||
if (fabs(NextSpeed.z) < 0.05)
|
|
||||||
{
|
|
||||||
NextSpeed.z = 0;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue