From 02a60a2756187594ba7db20d650e42ffa921ee2f Mon Sep 17 00:00:00 2001 From: Acruid Date: Mon, 22 Feb 2021 01:11:05 -0800 Subject: [PATCH] Fixes construction menu from throwing exceptions after round start. --- Content.Client/Construction/ConstructionMenuPresenter.cs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Content.Client/Construction/ConstructionMenuPresenter.cs b/Content.Client/Construction/ConstructionMenuPresenter.cs index efff7f3256..319e6eac62 100644 --- a/Content.Client/Construction/ConstructionMenuPresenter.cs +++ b/Content.Client/Construction/ConstructionMenuPresenter.cs @@ -109,7 +109,12 @@ namespace Content.Client.Construction PopulateCategories(); OnViewPopulateRecipes(_constructionView, (string.Empty, string.Empty)); - _gameHud.CraftingButtonToggled += b => WindowOpen = b; + _gameHud.CraftingButtonToggled += OnHudCraftingButtonToggled; + } + + private void OnHudCraftingButtonToggled(bool b) + { + WindowOpen = b; } /// @@ -121,6 +126,8 @@ namespace Content.Client.Construction _systemManager.SystemUnloaded -= OnSystemUnloaded; _placementManager.PlacementChanged -= OnPlacementChanged; + + _gameHud.CraftingButtonToggled -= OnHudCraftingButtonToggled; } private void OnPlacementChanged(object? sender, EventArgs e)