0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-13 09:50:43 -05:00
modules/project/SPT.SinglePlayer/Patches/RaidFix/RemoveUsedBotProfilePatch.cs

30 lines
788 B
C#

using SPT.Reflection.Patching;
using System.Reflection;
using SPT.Reflection.Utils;
namespace SPT.SinglePlayer.Patches.RaidFix
{
public class RemoveUsedBotProfilePatch : ModulePatch
{
static RemoveUsedBotProfilePatch()
{
_ = nameof(IGetProfileData.ChooseProfile);
}
protected override MethodBase GetTargetMethod()
{
return typeof(BotsPresets).BaseType.GetMethods().SingleCustom(m => m.Name == nameof(BotsPresets.GetNewProfile) && m.IsVirtual);
}
/// <summary>
/// BotsPresets.GetNewProfile()
[PatchPrefix]
public static bool PatchPrefix(ref bool withDelete)
{
withDelete = true;
return true; // Do original method
}
}
}