Merge pull request #1 from pozhiloy-enotik/master

You can fly even in lobby
This commit was merged in pull request #1.
This commit is contained in:
ALittlePatate
2022-05-10 19:35:40 +02:00
committed by GitHub
2 changed files with 20 additions and 1 deletions

View File

@@ -1,3 +1,5 @@
using UnityEngine;
namespace DevourClient.Helpers
{
public class Player
@@ -7,5 +9,22 @@
OptionsHelpers optionsHelpers = UnityEngine.Object.FindObjectOfType<OptionsHelpers>();
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");
}
if (this.fly && Player.IsInGame())
if (this.fly && Player.IsInGameOrLobby())
{
Hacks.Misc.Fly(this.fly_speed);
}