Try-catch statements for Harmony patches

This commit is contained in:
SDraw 2022-09-13 08:09:33 +03:00
parent bee29e7771
commit 4e3d5dd6d4
No known key found for this signature in database
GPG key ID: BB95B4DAB2BB8BB5
6 changed files with 93 additions and 37 deletions

View file

@ -317,18 +317,32 @@ namespace ml_lme
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
void OnAvatarClear()
{
if(m_leapTracked != null)
m_leapTracked.OnAvatarClear();
try
{
if(m_leapTracked != null)
m_leapTracked.OnAvatarClear();
}
catch(System.Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
// Sneaky forced IndexIK calibration
static void OnSetupAvatarGeneral_Postfix() => ms_instance?.OnSetupAvatarGeneral();
void OnSetupAvatarGeneral()
{
if(m_leapTracked != null)
m_leapTracked.OnSetupAvatarGeneral();
try
{
if(m_leapTracked != null)
m_leapTracked.OnSetupAvatarGeneral();
OnSettingsHeadAttachChange(Settings.HeadAttach);
OnSettingsHeadAttachChange(Settings.HeadAttach);
}
catch(System.Exception e)
{
MelonLoader.MelonLogger.Error(e);
}
}
// Utilities