Make RoundEndSystem properly reset & CommunicationsConsoleComponent less crashy (#2629)

This commit is contained in:
20kdc
2020-11-26 17:07:46 +00:00
committed by GitHub
parent 380d76f4cd
commit 060d4566c4
2 changed files with 20 additions and 2 deletions

View File

@@ -42,7 +42,16 @@ namespace Content.Server.GameObjects.Components.Command
private void UpdateBoundInterface()
{
UserInterface?.SetState(new CommunicationsConsoleInterfaceState(RoundEndSystem.ExpectedCountdownEnd));
if (!Deleted)
UserInterface?.SetState(new CommunicationsConsoleInterfaceState(RoundEndSystem.ExpectedCountdownEnd));
}
public override void OnRemove()
{
RoundEndSystem.OnRoundEndCountdownStarted -= UpdateBoundInterface;
RoundEndSystem.OnRoundEndCountdownCancelled -= UpdateBoundInterface;
RoundEndSystem.OnRoundEndCountdownFinished -= UpdateBoundInterface;
base.OnRemove();
}
private void UserInterfaceOnOnReceiveMessage(ServerBoundUserInterfaceMessage obj)