mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-03 18:39:23 +00:00
Clean up based on static analyzer suggestions
This commit is contained in:
parent
a7f4c96748
commit
ecba461845
39 changed files with 165 additions and 146 deletions
|
@ -25,13 +25,13 @@ namespace ml_pmc
|
|||
try
|
||||
{
|
||||
p_instance.Patch(
|
||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.ClearAvatar)),
|
||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.ClearAvatar), BindingFlags.Instance | BindingFlags.Public),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(GameEvents).GetMethod(nameof(OnAvatarClear_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
|
||||
p_instance.Patch(
|
||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetupAvatar)),
|
||||
typeof(PlayerSetup).GetMethod(nameof(PlayerSetup.SetupAvatar), BindingFlags.Instance | BindingFlags.Public),
|
||||
null,
|
||||
new HarmonyLib.HarmonyMethod(typeof(GameEvents).GetMethod(nameof(OnSetupAvatar_Postfix), BindingFlags.Static | BindingFlags.NonPublic))
|
||||
);
|
||||
|
|
|
@ -16,13 +16,6 @@ namespace ml_pmc
|
|||
MelonLoader.MelonCoroutines.Start(WaitForLocalPlayer());
|
||||
}
|
||||
|
||||
public override void OnDeinitializeMelon()
|
||||
{
|
||||
if(m_poseCopycat != null)
|
||||
Object.Destroy(m_poseCopycat.gameObject);
|
||||
m_poseCopycat = null;
|
||||
}
|
||||
|
||||
System.Collections.IEnumerator WaitForLocalPlayer()
|
||||
{
|
||||
while(PlayerSetup.Instance == null)
|
||||
|
@ -30,5 +23,12 @@ namespace ml_pmc
|
|||
|
||||
m_poseCopycat = new GameObject("[PlayerMovementCopycat]").AddComponent<PoseCopycat>();
|
||||
}
|
||||
|
||||
public override void OnDeinitializeMelon()
|
||||
{
|
||||
if(m_poseCopycat != null)
|
||||
Object.Destroy(m_poseCopycat.gameObject);
|
||||
m_poseCopycat = null;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,7 +90,7 @@ namespace ml_pmc
|
|||
l_hits.RemoveAll(hit => hit.collider.gameObject.layer == LayerMask.NameToLayer("PlayerLocal"));
|
||||
l_hits.RemoveAll(hit => hit.collider.gameObject.layer == LayerMask.NameToLayer("PlayerClone"));
|
||||
l_hits.Sort((a, b) => ((a.distance < b.distance) ? -1 : 1));
|
||||
l_result = (l_hits.First().collider.gameObject.transform.root == p_target.transform.root);
|
||||
l_result = (l_hits[0].collider.gameObject.transform.root == p_target.transform.root);
|
||||
}
|
||||
}
|
||||
return l_result;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue