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#
Raw Normal View History

2024-05-21 19:10:17 +01:00
using SPT.Reflection.Patching;
2023-03-03 18:52:31 +00:00
using System.Reflection;
2024-05-21 19:10:17 +01:00
using SPT.Reflection.Utils;
2023-03-03 18:52:31 +00:00
2024-05-21 19:10:17 +01:00
namespace SPT.SinglePlayer.Patches.RaidFix
2023-03-03 18:52:31 +00:00
{
public class RemoveUsedBotProfilePatch : ModulePatch
{
static RemoveUsedBotProfilePatch()
{
_ = nameof(IGetProfileData.ChooseProfile);
2023-03-03 18:52:31 +00:00
}
protected override MethodBase GetTargetMethod()
{
return typeof(BotsPresets).BaseType.GetMethods().SingleCustom(m => m.Name == nameof(BotsPresets.GetNewProfile) && m.IsVirtual);
2023-03-03 18:52:31 +00:00
}
2023-07-28 10:01:11 +01:00
/// <summary>
/// BotsPresets.GetNewProfile()
2023-03-03 18:52:31 +00:00
[PatchPrefix]
public static bool PatchPrefix(ref bool withDelete)
2023-03-03 18:52:31 +00:00
{
2023-07-07 15:01:45 +01:00
withDelete = true;
return true; // Do original method
2023-03-03 18:52:31 +00:00
}
}
}