mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 06:10:45 -05:00
Added new patch to fix bots spawning on Sandbox( Ground Zero )
This commit is contained in:
parent
9244abe669
commit
a0f2bb9261
@ -48,6 +48,7 @@ namespace Aki.Custom
|
|||||||
//new RankPanelPatch().Enable();
|
//new RankPanelPatch().Enable();
|
||||||
new RagfairFeePatch().Enable();
|
new RagfairFeePatch().Enable();
|
||||||
new ScavQuestPatch().Enable();
|
new ScavQuestPatch().Enable();
|
||||||
|
new FixBrokenSpawnOnSandboxPatch().Enable();
|
||||||
}
|
}
|
||||||
catch (Exception ex)
|
catch (Exception ex)
|
||||||
{
|
{
|
||||||
|
39
project/Aki.Custom/Patches/FixBrokenSpawnOnSandboxPatch.cs
Normal file
39
project/Aki.Custom/Patches/FixBrokenSpawnOnSandboxPatch.cs
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
using Aki.Reflection.Patching;
|
||||||
|
using Comfort.Common;
|
||||||
|
using EFT;
|
||||||
|
using HarmonyLib;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Reflection;
|
||||||
|
using UnityEngine;
|
||||||
|
|
||||||
|
namespace Aki.Custom.Patches
|
||||||
|
{
|
||||||
|
/// <summary>
|
||||||
|
/// Fixes the map sandbox from only spawning 1 bot at start of game as well as fixing no spawns till all bots are dead.
|
||||||
|
/// Remove once BSG decides to fix their map
|
||||||
|
/// </summary>
|
||||||
|
public class FixBrokenSpawnOnSandboxPatch : ModulePatch
|
||||||
|
{
|
||||||
|
protected override MethodBase GetTargetMethod()
|
||||||
|
{
|
||||||
|
return AccessTools.Method(typeof(GameWorld), nameof(GameWorld.OnGameStarted));
|
||||||
|
}
|
||||||
|
|
||||||
|
[PatchPrefix]
|
||||||
|
private static void PatchPrefix()
|
||||||
|
{
|
||||||
|
var gameWorld = Singleton<GameWorld>.Instance;
|
||||||
|
if (gameWorld == null)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var playerLocation = gameWorld.MainPlayer.Location;
|
||||||
|
|
||||||
|
if (playerLocation == "Sandbox")
|
||||||
|
{
|
||||||
|
Object.FindObjectsOfType<BotZone>().ToList().First(x => x.name == "ZoneSandbox").MaxPersonsOnPatrol = 10;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
Loading…
x
Reference in New Issue
Block a user