0
0
mirror of https://github.com/sp-tarkov/modules.git synced 2025-02-12 21:10:45 -05:00

Add patch

This commit is contained in:
Kaeno 2024-07-07 09:24:33 +00:00 committed by Dev
parent a08c7ff66d
commit 4ae4e8af5f
2 changed files with 32 additions and 0 deletions

View File

@ -0,0 +1,31 @@
using HarmonyLib;
using SPT.Reflection.Patching;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using System.Text;
using System.Threading.Tasks;
namespace SPT.Custom.Patches
{
/// <summary>
/// If Scav war is turned on Botsgroup can be null for some reason if null return early to not softlock player.
/// </summary>
public class FixBotgroupMarkofTheUnknown : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(BotsGroupMarkOfUnknown), nameof(BotsGroupMarkOfUnknown.Dispose));
}
[PatchPrefix]
private static bool PatchPrefix(BotsGroup ____groups)
{
if (____groups == null)
{
return false;
}
return true;
}
}
}

View File

@ -57,6 +57,7 @@ namespace SPT.Custom
new BossSpawnChancePatch().Enable();
new LocationLootCacheBustingPatch().Enable();
new VersionLabelPatch().Enable();
new FixBotgroupMarkofTheUnknown().Enable();
HookObject.AddOrGetComponent<MenuNotificationManager>();
}