Cleanup flashbangs. Fixes #1305

This commit is contained in:
Víctor Aguilera Puerto
2020-07-08 00:51:08 +02:00
parent 1616b0d867
commit 271945e1a5
5 changed files with 63 additions and 88 deletions

View File

@@ -16,7 +16,7 @@ using Timer = Robust.Shared.Timers.Timer;
namespace Content.Client.GameObjects.Components.Weapons
{
[RegisterComponent]
public sealed class ClientFlashableComponent : SharedFlashableComponent
public sealed class FlashableComponent : SharedFlashableComponent
{
private CancellationTokenSource _cancelToken;
private TimeSpan _startTime;
@@ -31,7 +31,7 @@ namespace Content.Client.GameObjects.Components.Weapons
}
var playerManager = IoCManager.Resolve<IPlayerManager>();
if (playerManager.LocalPlayer.ControlledEntity != Owner)
if (playerManager?.LocalPlayer != null && playerManager.LocalPlayer.ControlledEntity != Owner)
{
return;
}