try/catch trader autoswitch

This commit is contained in:
Tyfon
2024-10-03 10:58:56 -07:00
parent 7f447d9cfa
commit 58ee16bee7

View File

@@ -3,6 +3,7 @@ using EFT.UI;
using EFT.UI.DragAndDrop;
using HarmonyLib;
using SPT.Reflection.Patching;
using System;
using System.Reflection;
using UnityEngine;
using UnityEngine.EventSystems;
@@ -83,6 +84,8 @@ public static class TradingAutoSwitchPatches
return true;
}
try
{
if (!___bool_8 && ctrlPressed && assortmentController.QuickFindTradingAppropriatePlace(__instance.Item, null))
{
__instance.ItemContext?.CloseDependentWindows();
@@ -102,6 +105,11 @@ public static class TradingAutoSwitchPatches
return false;
}
}
catch (Exception e)
{
Logger.LogError(e);
}
return true;
}