mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 09:50:43 -05:00
Improved maxbotpatch
to pass the map location being requested
This commit is contained in:
parent
43c8ba5418
commit
599b5ec520
@ -1,3 +1,5 @@
|
|||||||
|
using Comfort.Common;
|
||||||
|
using EFT;
|
||||||
using SPT.Common.Http;
|
using SPT.Common.Http;
|
||||||
using SPT.Reflection.Patching;
|
using SPT.Reflection.Patching;
|
||||||
using SPT.Reflection.Utils;
|
using SPT.Reflection.Utils;
|
||||||
@ -35,7 +37,10 @@ namespace SPT.SinglePlayer.Patches.RaidFix
|
|||||||
[PatchPrefix]
|
[PatchPrefix]
|
||||||
private static void PatchPreFix(ref int maxCount)
|
private static void PatchPreFix(ref int maxCount)
|
||||||
{
|
{
|
||||||
if (int.TryParse(RequestHandler.GetJson("/singleplayer/settings/bot/maxCap"), out int parsedMaxCount))
|
var gameWorld = Singleton<GameWorld>.Instance;
|
||||||
|
var location = gameWorld.MainPlayer.Location;
|
||||||
|
|
||||||
|
if (int.TryParse(RequestHandler.GetJson($"/singleplayer/settings/bot/maxCap/{location ?? "default"}"), out int parsedMaxCount))
|
||||||
{
|
{
|
||||||
Logger.LogWarning($"Set max bot cap to: {parsedMaxCount}");
|
Logger.LogWarning($"Set max bot cap to: {parsedMaxCount}");
|
||||||
maxCount = parsedMaxCount;
|
maxCount = parsedMaxCount;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user