mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 10:29:22 +00:00
Fix for nightly and scripting branches
This commit is contained in:
parent
bcbb07c172
commit
8bead6a764
1 changed files with 14 additions and 3 deletions
|
@ -17,10 +17,8 @@ namespace ml_prm
|
|||
GameEvents.Init(HarmonyInstance);
|
||||
WorldHandler.Init();
|
||||
|
||||
// Whitelist the toggle script
|
||||
(typeof(SharedFilter).GetField("_localComponentWhitelist", BindingFlags.NonPublic | BindingFlags.Static)?.GetValue(null) as HashSet<Type>)?.Add(typeof(RagdollToggle));
|
||||
|
||||
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
|
||||
MelonLoader.MelonCoroutines.Start(WaitForWhitelist());
|
||||
}
|
||||
|
||||
public override void OnDeinitializeMelon()
|
||||
|
@ -39,5 +37,18 @@ namespace ml_prm
|
|||
|
||||
m_localController = PlayerSetup.Instance.gameObject.AddComponent<RagdollController>();
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator WaitForWhitelist()
|
||||
{
|
||||
// Whitelist the toggle script
|
||||
FieldInfo l_field = typeof(SharedFilter).GetField("_localComponentWhitelist", BindingFlags.NonPublic | BindingFlags.Static);
|
||||
HashSet<Type> l_hashSet = l_field?.GetValue(null) as HashSet<Type>;
|
||||
while(l_hashSet == null)
|
||||
{
|
||||
l_hashSet = l_field?.GetValue(null) as HashSet<Type>;
|
||||
yield return null;
|
||||
}
|
||||
l_hashSet.Add(typeof(RagdollToggle));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue