From b949b77d53a512e4bf9afaa547c4d0f9f0f05b83 Mon Sep 17 00:00:00 2001 From: Gleb Mazovetskiy Date: Fri, 1 Nov 2019 19:53:58 +0000 Subject: [PATCH] Drop held item when closing inventory Previously the item was just destroyed instead --- SourceX/miniwin/misc_msg.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/SourceX/miniwin/misc_msg.cpp b/SourceX/miniwin/misc_msg.cpp index 5f8564f9e..b3438a253 100644 --- a/SourceX/miniwin/misc_msg.cpp +++ b/SourceX/miniwin/misc_msg.cpp @@ -438,6 +438,9 @@ WINBOOL PeekMessageA(LPMSG lpMsg, HWND hWnd, UINT wMsgFilterMin, UINT wMsgFilter HideCursorIfNotNeeded(); break; case GameActionType::TOGGLE_INVENTORY: + if (pcurs >= CURSOR_FIRSTITEM && invflag) + // Drop item so that it does not get destroyed. + DropItemBeforeTrig(); sbookflag = false; invflag = !invflag; if (invflag)