Fixes the client crashing when closed. When disconnecting from a server, _playerManager.LocalPlayer is set to null before the entity components are disposed. Previously this would throw a nullref exception in ClientStatusEffectsComponent, now it properly checks for the null value. This resolves #435.
This commit is contained in:
@@ -32,7 +32,7 @@ namespace Content.Client.GameObjects.Components.Mobs
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// Allows calculating if we need to act due to this component being controlled by the current mob
|
/// Allows calculating if we need to act due to this component being controlled by the current mob
|
||||||
/// </summary>
|
/// </summary>
|
||||||
private bool CurrentlyControlled => _playerManager.LocalPlayer.ControlledEntity == Owner;
|
private bool CurrentlyControlled => _playerManager.LocalPlayer != null && _playerManager.LocalPlayer.ControlledEntity == Owner;
|
||||||
|
|
||||||
protected override void Shutdown()
|
protected override void Shutdown()
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user