mirror of
https://github.com/sp-tarkov/modules.git
synced 2025-02-13 02:30:44 -05:00
Gets the value from server. No longer hard coded to 10
This commit is contained in:
parent
1759abd842
commit
625442d2e3
@ -1,7 +1,9 @@
|
||||
using Aki.Reflection.Patching;
|
||||
using Aki.Common.Http;
|
||||
using Aki.Reflection.Patching;
|
||||
using Comfort.Common;
|
||||
using EFT;
|
||||
using HarmonyLib;
|
||||
using Newtonsoft.Json;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using UnityEngine;
|
||||
@ -32,8 +34,14 @@ namespace Aki.Custom.Patches
|
||||
|
||||
if (playerLocation == "Sandbox")
|
||||
{
|
||||
Object.FindObjectsOfType<BotZone>().ToList().First(x => x.name == "ZoneSandbox").MaxPersonsOnPatrol = 10;
|
||||
}
|
||||
Object.FindObjectsOfType<BotZone>().ToList().First(x => x.name == "ZoneSandbox").MaxPersonsOnPatrol = GetMaxPatrolValueFromServer();
|
||||
}
|
||||
}
|
||||
|
||||
public static int GetMaxPatrolValueFromServer()
|
||||
{
|
||||
string json = RequestHandler.GetJson("/singleplayer/sandbox/maxpatrol");
|
||||
return JsonConvert.DeserializeObject<int>(json);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user