From dc3342c953fd7ae2d8cfef946809ed7fe92c7521 Mon Sep 17 00:00:00 2001 From: hydrant Date: Sun, 28 Jul 2019 22:01:40 +0200 Subject: [PATCH] try fix inventory --- .../inventory/inventory.ts | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/ReallifeGamemode.Client/inventory/inventory.ts b/ReallifeGamemode.Client/inventory/inventory.ts index 846a062a..b02afda5 100644 --- a/ReallifeGamemode.Client/inventory/inventory.ts +++ b/ReallifeGamemode.Client/inventory/inventory.ts @@ -11,9 +11,12 @@ export default function inventory(globalData: GlobalData): void { mp.events.add("openTradeWindow", (money1, itemIdArr1, itemAmountArr1) => { if (!globalData.InMenu) { if (invBrowser !== null) { - invBrowser.destroy() - invBrowser = null; - mp.gui.cursor.show(false, false); + try { + invBrowser.destroy() + invBrowser = null; + } finally { + mp.gui.cursor.show(false, false); + } return; } mp.gui.cursor.show(true, true); @@ -29,9 +32,13 @@ export default function inventory(globalData: GlobalData): void { mp.events.add('inventoryShow', (itemIdArr1, itemAmountArr1) => { if (!globalData.InMenu) { if (invBrowser !== null) { - invBrowser.destroy() - invBrowser = null; - mp.gui.cursor.show(false, false); + try { + invBrowser.destroy() + invBrowser = null; + } + finally { + mp.gui.cursor.show(false, false); + } return; }