mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +00:00
Fixed issue with fluid volumes
This commit is contained in:
parent
b10b43453f
commit
96bc8a1cc9
4 changed files with 15 additions and 2 deletions
|
@ -1,4 +1,4 @@
|
|||
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.1.0", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.1.1", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
|
||||
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
|
||||
[assembly: MelonLoader.MelonPriority(2)]
|
||||
[assembly: MelonLoader.MelonOptionalDependencies("BTKUILib")]
|
||||
|
|
|
@ -534,6 +534,7 @@ namespace ml_prm
|
|||
if(MovementSystem.Instance.flying)
|
||||
MovementSystem.Instance.ChangeFlight(false);
|
||||
MovementSystem.Instance.SetImmobilized(true);
|
||||
MovementSystem.Instance.ClearFluidVolumes();
|
||||
BodySystem.TrackingPositionWeight = 0f;
|
||||
m_applyHipsPosition = IKSystem.Instance.applyOriginalHipPosition;
|
||||
IKSystem.Instance.applyOriginalHipPosition = true;
|
||||
|
@ -601,6 +602,9 @@ namespace ml_prm
|
|||
foreach(Rigidbody l_body in m_rigidBodies)
|
||||
l_body.isKinematic = true;
|
||||
|
||||
foreach(PhysicsInfluencer l_physicsInfluencer in m_physicsInfluencers)
|
||||
l_physicsInfluencer.ClearFluidVolumes();
|
||||
|
||||
m_lastPosition = PlayerSetup.Instance.transform.position;
|
||||
m_velocity = Vector3.zero;
|
||||
m_downTime = float.MinValue;
|
||||
|
|
|
@ -11,7 +11,10 @@ namespace ml_prm
|
|||
{
|
||||
static readonly FieldInfo ms_groundedRaw = typeof(MovementSystem).GetField("_isGroundedRaw", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_appliedGravity = typeof(MovementSystem).GetField("_appliedGravity", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_touchingVolumes = typeof(MovementSystem).GetField("_touchingVolumes", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_referencePoints = typeof(PhysicsInfluencer).GetField("_referencePoints", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_influencerTouchingVolumes = typeof(PhysicsInfluencer).GetField("_touchingVolumes", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_influencerSubmergedColliders = typeof(PhysicsInfluencer).GetField("_submergedColliders", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
|
||||
public static bool IsInVR() => ((CheckVR.Instance != null) && CheckVR.Instance.hasVrDeviceLoaded);
|
||||
public static bool IsWorldSafe() => ((CVRWorld.Instance != null) && CVRWorld.Instance.allowFlying);
|
||||
|
@ -31,6 +34,7 @@ namespace ml_prm
|
|||
public static bool IsGrounded(this MovementSystem p_instance) => (bool)ms_groundedRaw.GetValue(p_instance);
|
||||
public static Vector3 GetAppliedGravity(this MovementSystem p_instance) => (Vector3)ms_appliedGravity.GetValue(p_instance);
|
||||
public static void SetAppliedGravity(this MovementSystem p_instance, Vector3 p_vec) => ms_appliedGravity.SetValue(p_instance, p_vec);
|
||||
public static void ClearFluidVolumes(this MovementSystem p_instance) => (ms_touchingVolumes.GetValue(p_instance) as List<FluidVolume>)?.Clear();
|
||||
|
||||
public static void CopyGlobal(this Transform p_source, Transform p_target)
|
||||
{
|
||||
|
@ -42,5 +46,10 @@ namespace ml_prm
|
|||
{
|
||||
return ((ms_referencePoints.GetValue(p_instance) as List<Vector3>).Count > 0);
|
||||
}
|
||||
public static void ClearFluidVolumes(this PhysicsInfluencer p_instance)
|
||||
{
|
||||
(ms_influencerTouchingVolumes.GetValue(p_instance) as List<FluidVolume>)?.Clear();
|
||||
(ms_influencerSubmergedColliders.GetValue(p_instance) as Dictionary<FluidVolume, int>)?.Clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
<TargetFramework>netstandard2.1</TargetFramework>
|
||||
<Platforms>x64</Platforms>
|
||||
<PackageId>PlayerRagdollMod</PackageId>
|
||||
<Version>1.1.0</Version>
|
||||
<Version>1.1.1</Version>
|
||||
<Authors>SDraw</Authors>
|
||||
<Company>None</Company>
|
||||
<Product>PlayerRagdollMod</Product>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue