From 599b5ec5203a32a9f4adcb7fae810b2103be5de0 Mon Sep 17 00:00:00 2001 From: Dev Date: Fri, 31 May 2024 22:00:29 +0100 Subject: [PATCH] Improved `maxbotpatch` to pass the map location being requested --- project/SPT.SinglePlayer/Patches/RaidFix/MaxBotPatch.cs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/project/SPT.SinglePlayer/Patches/RaidFix/MaxBotPatch.cs b/project/SPT.SinglePlayer/Patches/RaidFix/MaxBotPatch.cs index 66c3a3c..3b077e0 100644 --- a/project/SPT.SinglePlayer/Patches/RaidFix/MaxBotPatch.cs +++ b/project/SPT.SinglePlayer/Patches/RaidFix/MaxBotPatch.cs @@ -1,3 +1,5 @@ +using Comfort.Common; +using EFT; using SPT.Common.Http; using SPT.Reflection.Patching; using SPT.Reflection.Utils; @@ -35,7 +37,10 @@ namespace SPT.SinglePlayer.Patches.RaidFix [PatchPrefix] private static void PatchPreFix(ref int maxCount) { - if (int.TryParse(RequestHandler.GetJson("/singleplayer/settings/bot/maxCap"), out int parsedMaxCount)) + var gameWorld = Singleton.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}"); maxCount = parsedMaxCount;