diff --git a/CHANGELOG.md b/CHANGELOG.md index 729069f..4f07323 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## [Unreleased] +### Fixed +- Fixed `IsConnected` not working properly. + ## [v3.2.0] ### Changed diff --git a/LethalNetworkAPI/Utils/LNetworkUtils.cs b/LethalNetworkAPI/Utils/LNetworkUtils.cs index d4c51ca..d63c1d5 100644 --- a/LethalNetworkAPI/Utils/LNetworkUtils.cs +++ b/LethalNetworkAPI/Utils/LNetworkUtils.cs @@ -27,7 +27,7 @@ public static int GetPlayerId(ulong clientGuid) => /// /// Whether the client is connected to a server. /// - public static bool IsConnected => NetworkManager.Singleton != null; + public static bool IsConnected => NetworkManager.Singleton?.IsConnectedClient ?? false; /// /// Whether the client is the host or server.