From 1f251987b1f2b2edc73ea51c865180c48d599eca Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Mon, 6 Mar 2023 20:29:13 +0100 Subject: [PATCH] MAX_PLAYERS should update when calling CreateCustomizedLobby it will NOT resize to default 4 when quitting the game but whatever, it should not break --- DevourClient/Hacks/Misc.cs | 3 ++- DevourClient/Helpers/StateHelper.cs | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/DevourClient/Hacks/Misc.cs b/DevourClient/Hacks/Misc.cs index dc67d85..29d5974 100644 --- a/DevourClient/Hacks/Misc.cs +++ b/DevourClient/Hacks/Misc.cs @@ -166,8 +166,9 @@ namespace DevourClient.Hacks public static void CreateCustomizedLobby(Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION, int lobbySize = 4, bool isPrivate = false) { + Entities.MAX_PLAYERS = lobbySize; //max players in the lobby - Il2CppUdpKit.Platform.PhotonPlatformConfig __photonPlatformConfig = new Il2CppUdpKit.Platform.PhotonPlatformConfig(); + Il2CppUdpKit.Platform.PhotonPlatformConfig __photonPlatformConfig = new Il2CppUdpKit.Platform.PhotonPlatformConfig(); __photonPlatformConfig.Region = Il2CppUdpKit.Platform.Photon.PhotonRegion.regions[__region]; BoltLauncher.SetUdpPlatform(new Il2CppUdpKit.Platform.PhotonPlatform(__photonPlatformConfig)); diff --git a/DevourClient/Helpers/StateHelper.cs b/DevourClient/Helpers/StateHelper.cs index 90b91c5..52be3c2 100644 --- a/DevourClient/Helpers/StateHelper.cs +++ b/DevourClient/Helpers/StateHelper.cs @@ -144,10 +144,10 @@ namespace DevourClient.Helpers public class Entities { - public const int MAX_PLAYERS = 4; //can change with new updates/new hacks + 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]; + public static BasePlayer[] Players = new BasePlayer[MAX_PLAYERS]; //i hope this doesn't break //public static GameObject[] Players = default!; public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!; public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!;