mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Co-authored-by: Kaeno <kaeno@noreply.dev.sp-tarkov.com> Co-authored-by: Dev <dev@dev.sp-tarkov.com> Reviewed-on: SPT/Modules#141
35 lines
1.1 KiB
C#
35 lines
1.1 KiB
C#
using EFT;
|
|
using HarmonyLib;
|
|
using SPT.Reflection.Patching;
|
|
using System.Reflection;
|
|
|
|
namespace SPT.Custom.Patches
|
|
{
|
|
public class PMCSpawnParamPatch : ModulePatch
|
|
{
|
|
protected override MethodBase GetTargetMethod()
|
|
{
|
|
return AccessTools.Method(typeof(BotSpawner), nameof(BotSpawner.GetGroupAndSetEnemies));
|
|
}
|
|
|
|
[PatchPrefix]
|
|
private static void PatchPrefix(BotOwner bot)
|
|
{
|
|
// is a boss and not a follower and not a PMC
|
|
if (!bot.Profile.Info.Settings.IsBoss() && !CustomAI.AiHelpers.BotIsSptPmc(bot.Profile.Info.Settings.Role, bot))
|
|
{
|
|
return;
|
|
}
|
|
// is a boss and follower and a pmc
|
|
if (bot.SpawnProfileData.SpawnParams == null)
|
|
{
|
|
bot.SpawnProfileData.SpawnParams = new BotSpawnParams();
|
|
}
|
|
if (bot.SpawnProfileData.SpawnParams.ShallBeGroup == null)
|
|
{
|
|
bot.SpawnProfileData.SpawnParams.ShallBeGroup = new ShallBeGroupParams(false, false);
|
|
}
|
|
}
|
|
}
|
|
}
|