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
|
@ -20,14 +20,6 @@ namespace ml_pin
|
|||
MelonLoader.MelonCoroutines.Start(WaitForInstances());
|
||||
}
|
||||
|
||||
public override void OnDeinitializeMelon()
|
||||
{
|
||||
m_soundManager = null;
|
||||
|
||||
CVRGameEventSystem.Player.OnJoinEntity.RemoveListener(OnPlayerJoin);
|
||||
CVRGameEventSystem.Player.OnLeaveEntity.RemoveListener(OnPlayerLeave);
|
||||
}
|
||||
|
||||
IEnumerator WaitForInstances()
|
||||
{
|
||||
if(InterfaceAudio.Instance == null)
|
||||
|
@ -40,6 +32,14 @@ namespace ml_pin
|
|||
CVRGameEventSystem.Player.OnLeaveEntity.AddListener(OnPlayerLeave);
|
||||
}
|
||||
|
||||
public override void OnDeinitializeMelon()
|
||||
{
|
||||
m_soundManager = null;
|
||||
|
||||
CVRGameEventSystem.Player.OnJoinEntity.RemoveListener(OnPlayerJoin);
|
||||
CVRGameEventSystem.Player.OnLeaveEntity.RemoveListener(OnPlayerLeave);
|
||||
}
|
||||
|
||||
void OnPlayerJoin(CVRPlayerEntity p_player)
|
||||
{
|
||||
try
|
||||
|
|
|
@ -73,7 +73,10 @@ namespace ml_pin
|
|||
StreamReader l_streadReader = new StreamReader(l_libraryStream);
|
||||
l_result = l_streadReader.ReadToEnd();
|
||||
}
|
||||
catch(Exception) { }
|
||||
catch(Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
|
||||
return l_result;
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ namespace ml_pin
|
|||
{
|
||||
static class Utils
|
||||
{
|
||||
static readonly FieldInfo ms_view = typeof(CohtmlControlledViewWrapper).GetField("_view", BindingFlags.NonPublic | BindingFlags.Instance);
|
||||
static readonly FieldInfo ms_view = typeof(CohtmlControlledViewWrapper).GetField("_view", BindingFlags.Instance | BindingFlags.NonPublic);
|
||||
|
||||
public static void ExecuteScript(this CohtmlControlledViewWrapper p_instance, string p_script) => ((cohtml.Net.View)ms_view.GetValue(p_instance)).ExecuteScript(p_script);
|
||||
public static void ExecuteScript(this CohtmlControlledViewWrapper p_instance, string p_script) => (ms_view?.GetValue(p_instance) as cohtml.Net.View)?.ExecuteScript(p_script);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue