You can fly even in lobby #1

Merged
pozhiloy-enotik merged 3 commits from master into master 2022-05-10 17:35:40 +00:00
2 changed files with 20 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
using UnityEngine;
namespace DevourClient.Helpers namespace DevourClient.Helpers
{ {
public class Player public class Player
@@ -7,5 +9,22 @@
OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType<OptionsHelpers>(); OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType<OptionsHelpers>();
return optionsHelpers.inGame; return optionsHelpers.inGame;
} }
public static bool IsInGameOrLobby()
{
return GetPlayer() != null;
}
public static NolanBehaviour GetPlayer()
{
foreach (NolanBehaviour nb in UnityEngine.Object.FindObjectsOfType<NolanBehaviour>())
{
if (nb.entity.IsOwner)
{
return nb;
}
}
return null;
}
} }
} }

View File

@@ -87,7 +87,7 @@ namespace DevourClient
Hacks.Misc.SetSteamName("patate"); Hacks.Misc.SetSteamName("patate");
} }
if (this.fly && Player.IsInGame()) if (this.fly && Player.IsInGameOrLobby())
{ {
Hacks.Misc.Fly(this.fly_speed); Hacks.Misc.Fly(this.fly_speed);
} }