From 92a8f700edff6db78a1d3c73a7090233623fd137 Mon Sep 17 00:00:00 2001 From: Xottab-DUTY Date: Fri, 27 Sep 2019 03:26:08 +0500 Subject: [PATCH] Fixed crash in upgrades windows Because of early return, upgrade window wasn't cleaned up and caused crashes. --- src/xrGame/ui/UIInventoryUpgradeWnd.cpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/xrGame/ui/UIInventoryUpgradeWnd.cpp b/src/xrGame/ui/UIInventoryUpgradeWnd.cpp index 7677e325312..1157734ad3e 100644 --- a/src/xrGame/ui/UIInventoryUpgradeWnd.cpp +++ b/src/xrGame/ui/UIInventoryUpgradeWnd.cpp @@ -103,9 +103,6 @@ void CUIInventoryUpgradeWnd::InitInventory(CUICellItem* cellItem, bool can_upgra if (m_item_info) m_item_info->InitItem(cellItem); - if (!cellItem) - return; - m_inv_item = static_cast(cellItem ? cellItem->m_pData : nullptr); // Загружаем картинку if (m_item && m_inv_item) @@ -146,6 +143,8 @@ void CUIInventoryUpgradeWnd::InitInventory(CUICellItem* cellItem, bool can_upgra else m_item->Show(false); } + else if (m_item) + m_item->Show(false); m_scheme_wnd->DetachAll(); m_scheme_wnd->Show(false);