mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +00:00
Stuck falling state fix
This commit is contained in:
parent
56686834d0
commit
e84bbacb8d
1 changed files with 8 additions and 0 deletions
|
@ -43,6 +43,7 @@ namespace ml_prm
|
|||
Vector3 m_lastPosition = Vector3.zero;
|
||||
Vector3 m_velocity = Vector3.zero;
|
||||
Vector3 m_ragdollLastPos = Vector3.zero;
|
||||
bool m_wasSwimming = false;
|
||||
|
||||
RagdollToggle m_avatarRagdollToggle = null;
|
||||
RagdollTrigger m_ragdollTrigger = null;
|
||||
|
@ -277,6 +278,7 @@ namespace ml_prm
|
|||
m_puppetRoot.localScale = Vector3.one;
|
||||
m_inAir = false;
|
||||
m_inAirDistance = 0f;
|
||||
m_wasSwimming = false;
|
||||
}
|
||||
|
||||
internal void OnAvatarSetup()
|
||||
|
@ -608,6 +610,8 @@ namespace ml_prm
|
|||
{
|
||||
if(CanRagdoll())
|
||||
{
|
||||
m_wasSwimming = BetterBetterCharacterController.Instance.IsSwimming();
|
||||
|
||||
if(BetterBetterCharacterController.Instance.IsFlying())
|
||||
BetterBetterCharacterController.Instance.ChangeFlight(false,true);
|
||||
BetterBetterCharacterController.Instance.SetImmobilized(true);
|
||||
|
@ -690,6 +694,10 @@ namespace ml_prm
|
|||
OnMovementDragChange(Settings.MovementDrag);
|
||||
OnAngularDragChange(Settings.AngularDrag);
|
||||
|
||||
// Restore movement if was ragdolled in water and left it
|
||||
if(m_wasSwimming)
|
||||
BetterBetterCharacterController.Instance.SetMovementMode(EasyCharacterMovement.MovementMode.Swimming);
|
||||
|
||||
m_enabled = false;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue