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

29 lines
1.0 KiB
C#
Raw Normal View History

2023-03-03 18:52:31 +00:00
using System.Collections.Generic;
using System.Reflection;
2024-05-21 19:10:17 +01:00
using SPT.PrePatch;
using SPT.Reflection.Patching;
2023-03-03 18:52:31 +00:00
using EFT;
using HarmonyLib;
2023-03-03 18:52:31 +00:00
2024-05-21 19:10:17 +01:00
namespace SPT.Custom.Patches
2023-03-03 18:52:31 +00:00
{
public class AddSptBotSettingsPatch : ModulePatch
{
protected override MethodBase GetTargetMethod()
{
return AccessTools.Method(typeof(BotSettingsRepoClass), nameof(BotSettingsRepoClass.Init));
2023-03-03 18:52:31 +00:00
}
[PatchPrefix]
private static void PatchPrefix(ref Dictionary<WildSpawnType, BotSettingsValuesClass> ___dictionary_0)
{
2024-05-21 19:10:17 +01:00
if (___dictionary_0.ContainsKey((WildSpawnType)SPTBotsPrePatcher.sptUsecValue))
2023-03-03 18:52:31 +00:00
{
return;
}
2024-05-21 19:10:17 +01:00
___dictionary_0.Add((WildSpawnType)SPTBotsPrePatcher.sptUsecValue, new BotSettingsValuesClass(false, false, false, EPlayerSide.Savage.ToStringNoBox()));
___dictionary_0.Add((WildSpawnType)SPTBotsPrePatcher.sptBearValue, new BotSettingsValuesClass(false, false, false, EPlayerSide.Savage.ToStringNoBox()));
2023-03-03 18:52:31 +00:00
}
}
}