Skip to content

Commit

Permalink
Fixed incorrect logic for LNetworkUtils.IsConnected
Browse files Browse the repository at this point in the history
  • Loading branch information
Xilophor committed Aug 27, 2024
1 parent 308de1e commit 7b8f0fe
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion LethalNetworkAPI/Utils/LNetworkUtils.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public static int GetPlayerId(ulong clientGuid) =>
/// <summary>
/// Whether the client is connected to a server.
/// </summary>
public static bool IsConnected => NetworkManager.Singleton != null;
public static bool IsConnected => NetworkManager.Singleton?.IsConnectedClient ?? false;

/// <summary>
/// Whether the client is the host or server.
Expand Down

0 comments on commit 7b8f0fe

Please sign in to comment.