Restricted drag fix

This commit is contained in:
SDraw 2023-04-18 23:25:35 +03:00
parent 427c346ba2
commit 1ef839af3f
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
2 changed files with 3 additions and 3 deletions

View file

@ -28,7 +28,7 @@ Optional mod's settings with [BTKUILib](https://github.com/BTK-Development/BTKUI
* Note: Limited according to world's fly multiplier.
* Note: Forcibly set to `1.0` in worlds that don't allow flight.
* **Movement drag:** movement resistance; `2.0` by default.
* Note: Forcibly set to `0.0` in worlds that don't allow flight.
* Note: Forcibly set to `1.0` in worlds that don't allow flight.
* **Angular movement drag:** angular movement resistance; `2.0` by default.
* **Recover delay:** time delay for enabled `Auto recover` in seconds; `3.0` by default.
* **Reset settings:** resets mod settings to default.

View file

@ -240,7 +240,7 @@ namespace ml_prm
m_rigidBodies.Add(l_body);
l_body.isKinematic = true;
l_body.angularDrag = Settings.AngularDrag;
l_body.drag = Settings.MovementDrag;
l_body.drag = (Utils.IsWorldSafe() ? Settings.MovementDrag : 1f);
l_body.useGravity = (!Utils.IsWorldSafe() || Settings.Gravity);
l_body.collisionDetectionMode = CollisionDetectionMode.ContinuousDynamic;
}
@ -337,7 +337,7 @@ namespace ml_prm
{
if(m_avatarReady)
{
float l_drag = (Utils.IsWorldSafe() ? p_value : 0f);
float l_drag = (Utils.IsWorldSafe() ? p_value : 1f);
foreach(Rigidbody l_body in m_rigidBodies)
{
l_body.drag = l_drag;