VRIKRootController behaviour fix

Flight toggle detection fix
This commit is contained in:
SDraw 2023-09-01 09:16:08 +03:00
parent 499de635ac
commit 3bed6f4201
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
8 changed files with 15 additions and 15 deletions

View file

@ -62,9 +62,9 @@ namespace ml_prm
null
);
HarmonyInstance.Patch(
typeof(MovementSystem).GetMethod(nameof(MovementSystem.ToggleFlight)),
typeof(MovementSystem).GetMethod(nameof(MovementSystem.ChangeFlight)),
null,
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnToggleFlight_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
new HarmonyLib.HarmonyMethod(typeof(PlayerRagdollMod).GetMethod(nameof(OnChangeFlight_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
);
// Whitelist the toggle script
@ -199,13 +199,13 @@ namespace ml_prm
}
}
static void OnToggleFlight_Postfix() => ms_instance?.OnToggleFlight();
void OnToggleFlight()
static void OnChangeFlight_Postfix() => ms_instance?.OnChangeFlight();
void OnChangeFlight()
{
try
{
if(m_localController != null)
m_localController.OnToggleFlight();
m_localController.OnChangeFlight();
}
catch(Exception e)
{

View file

@ -1,6 +1,6 @@
using System.Reflection;
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.0.7", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonInfo(typeof(ml_prm.PlayerRagdollMod), "PlayerRagdollMod", "1.0.8", "SDraw", "https://github.com/SDraw/ml_mods_cvr")]
[assembly: MelonLoader.MelonGame(null, "ChilloutVR")]
[assembly: MelonLoader.MelonPriority(2)]
[assembly: MelonLoader.MelonOptionalDependencies("BTKUILib")]

View file

@ -348,7 +348,7 @@ namespace ml_prm
}
}
internal void OnToggleFlight()
internal void OnChangeFlight()
{
if(m_avatarReady && m_enabled && MovementSystem.Instance.flying)
SwitchRagdoll();

View file

@ -4,7 +4,7 @@
<TargetFramework>netstandard2.1</TargetFramework>
<Platforms>x64</Platforms>
<PackageId>PlayerRagdollMod</PackageId>
<Version>1.0.7</Version>
<Version>1.0.8</Version>
<Authors>SDraw</Authors>
<Company>None</Company>
<Product>PlayerRagdollMod</Product>