From b1e184131189a51b15c0fa38fd65242a3655551f Mon Sep 17 00:00:00 2001 From: Kaeno Date: Sun, 17 Mar 2024 16:00:40 +0000 Subject: [PATCH] Small optimization --- project/Aki.Custom/Patches/FixBrokenSpawnOnSandboxPatch.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/project/Aki.Custom/Patches/FixBrokenSpawnOnSandboxPatch.cs b/project/Aki.Custom/Patches/FixBrokenSpawnOnSandboxPatch.cs index c2841fe..7edf2d4 100644 --- a/project/Aki.Custom/Patches/FixBrokenSpawnOnSandboxPatch.cs +++ b/project/Aki.Custom/Patches/FixBrokenSpawnOnSandboxPatch.cs @@ -6,7 +6,6 @@ using HarmonyLib; using Newtonsoft.Json; using System.Linq; using System.Reflection; -using UnityEngine; namespace Aki.Custom.Patches { @@ -34,9 +33,9 @@ namespace Aki.Custom.Patches if (playerLocation == "Sandbox") { - Object.FindObjectsOfType().ToList().First(x => x.name == "ZoneSandbox").MaxPersonsOnPatrol = GetMaxPatrolValueFromServer(); + LocationScene.GetAll().ToList().First(x => x.name == "ZoneSandbox").MaxPersonsOnPatrol = GetMaxPatrolValueFromServer(); } - } + } public static int GetMaxPatrolValueFromServer() {