From 428127f620dc2b2dc4002a46b34005d76cfb00bb Mon Sep 17 00:00:00 2001 From: MihailRis Date: Thu, 12 Feb 2026 01:58:00 +0300 Subject: [PATCH] another cleanup --- src/logic/scripting/lua/libs/libgui.cpp | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/logic/scripting/lua/libs/libgui.cpp b/src/logic/scripting/lua/libs/libgui.cpp index 0ec5e6475..514f3f98d 100644 --- a/src/logic/scripting/lua/libs/libgui.cpp +++ b/src/logic/scripting/lua/libs/libgui.cpp @@ -32,10 +32,7 @@ using namespace scripting; static DocumentNode get_document_node_impl( lua::State*, const std::string& name, const std::string& nodeName, bool throwable=true ) { - if (engine->isHeadless()) { - throw std::runtime_error("not available in headless mode"); - } - auto doc = engine->getAssets()->get(name); + auto doc = engine->requireAssets().get(name); if (doc == nullptr) { if (throwable) { throw std::runtime_error("document '" + name + "' not found"); @@ -1029,7 +1026,7 @@ static int l_gui_str(lua::State* L) { static int l_gui_reindex(lua::State* L) { auto name = lua::require_string(L, 1); - auto doc = engine->getAssets()->get(name); + auto doc = engine->requireAssets().get(name); if (doc == nullptr) { throw std::runtime_error( "document '" + std::string(name) + "' not found" @@ -1127,7 +1124,7 @@ static int l_gui_load_document(lua::State* L) { engine->getGUI(), std::move(env), alias, filename, filename.string() ); auto document = documentPtr.get(); - engine->getAssets()->store(std::move(documentPtr), alias); + engine->requireAssets().store(std::move(documentPtr), alias); // namespace extension if (lua::istable(L, 4)) {