mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-05 11:29:23 +00:00
Fix of velocity when ragdolling in flight mode
This commit is contained in:
parent
b05447c4df
commit
eb44662935
1 changed files with 12 additions and 5 deletions
|
@ -418,6 +418,7 @@ namespace ml_prm
|
||||||
m_forcedSwitch = true;
|
m_forcedSwitch = true;
|
||||||
SwitchRagdoll();
|
SwitchRagdoll();
|
||||||
m_forcedSwitch = false;
|
m_forcedSwitch = false;
|
||||||
|
ResetStates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -428,6 +429,7 @@ namespace ml_prm
|
||||||
m_forcedSwitch = true;
|
m_forcedSwitch = true;
|
||||||
SwitchRagdoll();
|
SwitchRagdoll();
|
||||||
m_forcedSwitch = false;
|
m_forcedSwitch = false;
|
||||||
|
ResetStates();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -452,18 +454,19 @@ namespace ml_prm
|
||||||
m_forcedSwitch = true;
|
m_forcedSwitch = true;
|
||||||
SwitchRagdoll();
|
SwitchRagdoll();
|
||||||
m_forcedSwitch = false;
|
m_forcedSwitch = false;
|
||||||
|
ResetStates(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal void OnChangeFlight()
|
internal void OnChangeFlight()
|
||||||
{
|
{
|
||||||
ResetStates();
|
|
||||||
|
|
||||||
if(m_avatarReady && m_enabled && MovementSystem.Instance.flying)
|
if(m_avatarReady && m_enabled && MovementSystem.Instance.flying)
|
||||||
{
|
{
|
||||||
m_forcedSwitch = true;
|
m_forcedSwitch = true;
|
||||||
SwitchRagdoll();
|
SwitchRagdoll();
|
||||||
m_forcedSwitch = false;
|
m_forcedSwitch = false;
|
||||||
|
|
||||||
|
ResetStates(false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -671,10 +674,14 @@ namespace ml_prm
|
||||||
|
|
||||||
public bool IsRagdolled() => (m_avatarReady && m_enabled);
|
public bool IsRagdolled() => (m_avatarReady && m_enabled);
|
||||||
|
|
||||||
void ResetStates()
|
void ResetStates(bool p_resetVelocity = true)
|
||||||
{
|
{
|
||||||
m_lastPosition = this.transform.position;
|
if(p_resetVelocity)
|
||||||
m_velocity = Vector3.zero;
|
{
|
||||||
|
m_lastPosition = this.transform.position;
|
||||||
|
m_velocity = Vector3.zero;
|
||||||
|
}
|
||||||
|
|
||||||
m_inAir = false;
|
m_inAir = false;
|
||||||
m_inAirDistance = 0f;
|
m_inAirDistance = 0f;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue