2024-05-22 19:57:31 +00:00
|
|
|
|
using HarmonyLib;
|
|
|
|
|
using SPT.Reflection.Patching;
|
|
|
|
|
using System.Reflection;
|
|
|
|
|
using static GetActionsClass;
|
|
|
|
|
|
|
|
|
|
namespace SPT.Custom.Patches
|
|
|
|
|
{
|
|
|
|
|
public class InsurancePlaceItem : ModulePatch
|
|
|
|
|
{
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
|
{
|
2024-06-07 18:25:19 +00:00
|
|
|
|
return AccessTools.Method(typeof(Class1496), nameof(Class1496.method_0));
|
2024-05-22 19:57:31 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
[PatchPostfix]
|
2024-06-07 18:25:19 +00:00
|
|
|
|
private static void PatchPostfix(Class1496 __instance, bool successful)
|
2024-05-22 19:57:31 +00:00
|
|
|
|
{
|
|
|
|
|
if (!successful)
|
|
|
|
|
{
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
SinglePlayer.Utils.Insurance.InsuredItemManager.Instance.SetPlacedItem(__instance.resultItem);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|