mirror of
https://github.com/hanetzer/sdraw_mods_cvr.git
synced 2025-09-04 02:49:23 +00:00
Try-catch statements for Harmony patches
This commit is contained in:
parent
bee29e7771
commit
4e3d5dd6d4
6 changed files with 93 additions and 37 deletions
|
@ -170,24 +170,31 @@ namespace ml_fpt
|
|||
static void OnAvatarClear_Postfix() => ms_instance?.OnAvatarClear();
|
||||
void OnAvatarClear()
|
||||
{
|
||||
if(m_inCalibration)
|
||||
try
|
||||
{
|
||||
m_indexIk.enabled = true;
|
||||
m_ikCalibrator.enabled = true;
|
||||
|
||||
m_ikCalibrator.leftHandModel.SetActive(false);
|
||||
m_ikCalibrator.rightHandModel.SetActive(false);
|
||||
|
||||
if(m_hipsTrackerIndex != -1)
|
||||
if(m_inCalibration)
|
||||
{
|
||||
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowTracker(false);
|
||||
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowLine(false);
|
||||
m_indexIk.enabled = true;
|
||||
m_ikCalibrator.enabled = true;
|
||||
|
||||
m_ikCalibrator.leftHandModel.SetActive(false);
|
||||
m_ikCalibrator.rightHandModel.SetActive(false);
|
||||
|
||||
if(m_hipsTrackerIndex != -1)
|
||||
{
|
||||
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowTracker(false);
|
||||
PlayerSetup.Instance._trackerManager.trackers[m_hipsTrackerIndex].ShowLine(false);
|
||||
}
|
||||
CVR_InteractableManager.enableInteractions = true;
|
||||
|
||||
Reset();
|
||||
|
||||
ShowHudNotification("Calibration canceled");
|
||||
}
|
||||
CVR_InteractableManager.enableInteractions = true;
|
||||
|
||||
Reset();
|
||||
|
||||
ShowHudNotification("Calibration canceled");
|
||||
}
|
||||
catch(System.Exception e)
|
||||
{
|
||||
MelonLoader.MelonLogger.Error(e);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue