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()
|
|
|
|
{
|
2023-10-10 10:58:33 +00:00
|
|
|
_ = nameof(IGetProfileData.ChooseProfile);
|
2023-03-03 18:52:31 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
protected override MethodBase GetTargetMethod()
|
|
|
|
{
|
2024-01-13 22:08:29 +00:00
|
|
|
return typeof(BotsPresets).BaseType.GetMethods().SingleCustom(m => m.Name == nameof(BotsPresets.GetNewProfile) && m.IsVirtual);
|
2023-03-03 18:52:31 +00:00
|
|
|
}
|
2024-01-13 22:08:29 +00:00
|
|
|
|
2023-07-28 10:01:11 +01:00
|
|
|
/// <summary>
|
|
|
|
/// BotsPresets.GetNewProfile()
|
2023-03-03 18:52:31 +00:00
|
|
|
[PatchPrefix]
|
2024-08-02 16:57:59 +01:00
|
|
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|