From 158afd9bd209c4e65dc630bb30da632a5e738803 Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Wed, 8 Mar 2023 08:50:30 +0100 Subject: [PATCH] fix: features not working with >4 players very unoptimal but that's in a corroutine ig that's fine --- DevourClient/Hacks/Misc.cs | 4 +--- DevourClient/Helpers/StateHelper.cs | 4 ++-- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/DevourClient/Hacks/Misc.cs b/DevourClient/Hacks/Misc.cs index 11ac424..92567b6 100644 --- a/DevourClient/Hacks/Misc.cs +++ b/DevourClient/Hacks/Misc.cs @@ -165,9 +165,7 @@ namespace DevourClient.Hacks } public static void CreateCustomizedLobby(int lobbySize = 4, bool isPrivate = false, Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION) - { - Entities.MAX_PLAYERS = lobbySize; //max players in the lobby - + { Il2CppHorror.Menu _menu = UnityEngine.Object.FindObjectOfType(); CanvasGroup _loadingCanvasGroup = _menu.loadingCanvasGroup; diff --git a/DevourClient/Helpers/StateHelper.cs b/DevourClient/Helpers/StateHelper.cs index fcf59d1..e6b387d 100644 --- a/DevourClient/Helpers/StateHelper.cs +++ b/DevourClient/Helpers/StateHelper.cs @@ -147,8 +147,7 @@ namespace DevourClient.Helpers public static int MAX_PLAYERS = 4; //will change by calling CreateCustomizedLobby public static BasePlayer LocalPlayer_ = new BasePlayer(); - public static BasePlayer[] Players = new BasePlayer[MAX_PLAYERS]; //i hope this doesn't break - //public static GameObject[] Players = default!; + public static BasePlayer[] Players = default!; public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!; public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!; public static Il2Cpp.KeyBehaviour[] Keys = default!; @@ -184,6 +183,7 @@ namespace DevourClient.Helpers for (;;) { GameObject[] players = GameObject.FindGameObjectsWithTag("Player"); + Players = new BasePlayer[players.Length]; int i = 0; foreach (GameObject p in players)