mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Fix Botgroups softlocking player from extracting from raid. (!147)
Reviewed-on: SPT/Modules#147
This commit is contained in:
parent
5eaadd1391
commit
a3404853ff
31
project/SPT.Custom/Patches/FixBotgroupMarkofTheUnknown.cs
Normal file
31
project/SPT.Custom/Patches/FixBotgroupMarkofTheUnknown.cs
Normal 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;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -81,6 +81,7 @@ namespace SPT.Custom
|
|||||||
new InsurancePlaceItem().Enable();
|
new InsurancePlaceItem().Enable();
|
||||||
new FileCachePatch().Enable();
|
new FileCachePatch().Enable();
|
||||||
new PMCSpawnParamPatch().Enable();
|
new PMCSpawnParamPatch().Enable();
|
||||||
|
new FixBotgroupMarkofTheUnknown().Enable();
|
||||||
|
|
||||||
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
HookObject.AddOrGetComponent<MenuNotificationManager>();
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user