From 2783b0af7be2f1a5dc6dc93041feb4fe11755641 Mon Sep 17 00:00:00 2001 From: MihailRis Date: Mon, 11 Aug 2025 23:53:49 +0300 Subject: [PATCH] possible hud.open bug fix --- src/frontend/hud.cpp | 1 + src/logic/scripting/lua/libs/libhud.cpp | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/frontend/hud.cpp b/src/frontend/hud.cpp index 60cee6c4..b122c632 100644 --- a/src/frontend/hud.cpp +++ b/src/frontend/hud.cpp @@ -538,6 +538,7 @@ void Hud::closeInventory() { exchangeSlotInv = nullptr; inventoryOpen = false; inventoryView = nullptr; + secondInvView = nullptr; secondUI = nullptr; for (auto& element : elements) { diff --git a/src/logic/scripting/lua/libs/libhud.cpp b/src/logic/scripting/lua/libs/libhud.cpp index 988685cc..432d8eb6 100644 --- a/src/logic/scripting/lua/libs/libhud.cpp +++ b/src/logic/scripting/lua/libs/libhud.cpp @@ -46,7 +46,7 @@ static int l_open(lua::State* L) { } return lua::pushinteger(L, hud->openInventory( layout, - level->inventories->get(invid), + lua::isnoneornil(L, 3) ? nullptr : level->inventories->get(invid), playerInventory )->getId()); }