From 27e6956f2de376c994d88285f47bcde6c868124c Mon Sep 17 00:00:00 2001 From: ALittlePatate Date: Mon, 6 Mar 2023 21:26:35 +0100 Subject: [PATCH] fixed Camera.main being null, changed arg order in CreateCustomizedLobby --- DevourClient/Hacks/Misc.cs | 2 +- DevourClient/Helpers/Render.cs | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/DevourClient/Hacks/Misc.cs b/DevourClient/Hacks/Misc.cs index 998a3a9..847a673 100644 --- a/DevourClient/Hacks/Misc.cs +++ b/DevourClient/Hacks/Misc.cs @@ -164,7 +164,7 @@ namespace DevourClient.Hacks catch { } } - public static void CreateCustomizedLobby(Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions __region = Il2CppUdpKit.Platform.Photon.PhotonRegion.Regions.BEST_REGION, int lobbySize = 4, bool isPrivate = false) + 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 diff --git a/DevourClient/Helpers/Render.cs b/DevourClient/Helpers/Render.cs index c6e706a..ce218a5 100644 --- a/DevourClient/Helpers/Render.cs +++ b/DevourClient/Helpers/Render.cs @@ -112,6 +112,11 @@ namespace DevourClient.Render public static void DrawBoxESP(GameObject it, float footOffset, float headOffset, string name, Color color, bool snapline = false, bool esp = false, float nameOffset = -0.5f, float widthOffset = 2.0f) { + if (!it || !Camera.main) + { + return; + } + Vector3 footpos = Camera.main.WorldToScreenPoint(new Vector3(it.transform.position.x, it.transform.position.y + footOffset, it.transform.position.z)); Vector3 headpos = Camera.main.WorldToScreenPoint(new Vector3(it.transform.position.x, it.transform.position.y + headOffset, it.transform.position.z)); Vector3 namepos = Camera.main.WorldToScreenPoint(new Vector3(it.transform.position.x, it.transform.position.y + nameOffset, it.transform.position.z));