try fix inventory

This commit is contained in:
hydrant
2019-07-28 22:01:40 +02:00
parent a4ca4e8ce3
commit dc3342c953

View File

@@ -11,9 +11,12 @@ export default function inventory(globalData: GlobalData): void {
mp.events.add("openTradeWindow", (money1, itemIdArr1, itemAmountArr1) => { mp.events.add("openTradeWindow", (money1, itemIdArr1, itemAmountArr1) => {
if (!globalData.InMenu) { if (!globalData.InMenu) {
if (invBrowser !== null) { if (invBrowser !== null) {
try {
invBrowser.destroy() invBrowser.destroy()
invBrowser = null; invBrowser = null;
} finally {
mp.gui.cursor.show(false, false); mp.gui.cursor.show(false, false);
}
return; return;
} }
mp.gui.cursor.show(true, true); mp.gui.cursor.show(true, true);
@@ -29,9 +32,13 @@ export default function inventory(globalData: GlobalData): void {
mp.events.add('inventoryShow', (itemIdArr1, itemAmountArr1) => { mp.events.add('inventoryShow', (itemIdArr1, itemAmountArr1) => {
if (!globalData.InMenu) { if (!globalData.InMenu) {
if (invBrowser !== null) { if (invBrowser !== null) {
try {
invBrowser.destroy() invBrowser.destroy()
invBrowser = null; invBrowser = null;
}
finally {
mp.gui.cursor.show(false, false); mp.gui.cursor.show(false, false);
}
return; return;
} }