LocalPlayer_ is now BasePlayer

This commit is contained in:
2023-01-08 21:24:56 +01:00
parent d633f4e2fb
commit 3d88b189a6
3 changed files with 10 additions and 10 deletions

View File

@@ -48,13 +48,13 @@ namespace DevourClient.Hacks
public static void WalkInLobby(bool walk) public static void WalkInLobby(bool walk)
{ {
try { try {
if (Helpers.Entities.LocalPlayer_.GetComponent<UltimateCharacterLocomotionHandler>() == null) if (Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent<UltimateCharacterLocomotionHandler>() == null)
{ {
Helpers.Entities.LocalPlayer_.AddComponent<UltimateCharacterLocomotionHandler>(); Helpers.Entities.LocalPlayer_.p_GameObject.AddComponent<UltimateCharacterLocomotionHandler>();
Helpers.Entities.LocalPlayer_.GetComponent<UltimateCharacterLocomotionHandler>().enabled = false; Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent<UltimateCharacterLocomotionHandler>().enabled = false;
} }
Helpers.Entities.LocalPlayer_.GetComponent<UltimateCharacterLocomotionHandler>().enabled = walk; Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent<UltimateCharacterLocomotionHandler>().enabled = walk;
} }
catch { return; } catch { return; }
} }

View File

@@ -21,12 +21,12 @@ namespace DevourClient.Helpers
public static Il2Cpp.NolanBehaviour GetPlayer() public static Il2Cpp.NolanBehaviour GetPlayer()
{ {
if (Entities.LocalPlayer_ == null) if (Entities.LocalPlayer_.p_GameObject == null)
{ {
return null!; return null!;
} }
return Entities.LocalPlayer_.GetComponent<Il2Cpp.NolanBehaviour>(); return Entities.LocalPlayer_.p_GameObject.GetComponent<Il2Cpp.NolanBehaviour>();
} }
public static bool IsPlayerCrawling() public static bool IsPlayerCrawling()
@@ -56,7 +56,7 @@ namespace DevourClient.Helpers
public class Entities public class Entities
{ {
public static GameObject LocalPlayer_ = default!; public static BasePlayer LocalPlayer_ = default!;
public static BasePlayer[] Players = default!; public static BasePlayer[] Players = default!;
public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!; public static Il2Cpp.GoatBehaviour[] GoatsAndRats = default!;
public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!; public static Il2Cpp.SurvivalInteractable[] SurvivalInteractables = default!;
@@ -76,7 +76,7 @@ namespace DevourClient.Helpers
{ {
if (currentPlayers[i].GetComponent<Il2Cpp.NolanBehaviour>().entity.IsOwner) if (currentPlayers[i].GetComponent<Il2Cpp.NolanBehaviour>().entity.IsOwner)
{ {
LocalPlayer_ = currentPlayers[i]; LocalPlayer_.p_GameObject = currentPlayers[i];
break; break;
} }
} }

View File

@@ -142,7 +142,7 @@ namespace DevourClient
{ {
try try
{ {
Helpers.Entities.LocalPlayer_.GetComponent<Il2CppOpsive.UltimateCharacterController.Character.UltimateCharacterLocomotion>().TimeScale = this._PlayerSpeedMultiplier; Helpers.Entities.LocalPlayer_.p_GameObject.GetComponent<Il2CppOpsive.UltimateCharacterController.Character.UltimateCharacterLocomotion>().TimeScale = this._PlayerSpeedMultiplier;
} }
catch { return; } catch { return; }
} }