Skip to content

Commit

Permalink
Restricted drag fix
Browse files Browse the repository at this point in the history
  • Loading branch information
SDraw committed Apr 18, 2023
1 parent 427c346 commit 1ef839a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ml_prm/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
4 changes: 2 additions & 2 deletions ml_prm/RagdollController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ internal void OnAvatarSetup()
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;
}
Expand Down Expand Up @@ -337,7 +337,7 @@ void OnMovementDragChange(float p_value)
{
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;
Expand Down

0 comments on commit 1ef839a

Please sign in to comment.