From 1a39ef07c86ca0c4bb6d1999becb8b478ee3ee24 Mon Sep 17 00:00:00 2001 From: elsid Date: Fri, 8 Dec 2023 00:00:54 +0100 Subject: [PATCH] Fix build with Lua 5.4.6 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit /home/elsid/dev/openmw/apps/openmw/mwlua/luamanagerimp.cpp: In member function ‘void MWLua::LuaManager::update()’: /home/elsid/dev/openmw/apps/openmw/mwlua/luamanagerimp.cpp:127:19: error: use of deleted function ‘Settings::SettingValue::SettingValue(const Settings::SettingValue&) [with T = int]’ 127 | lua_gc(mLua.sol(), LUA_GCSTEP, Settings::lua().mGcStepsPerFrame); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /home/elsid/dev/openmw/components/settings/categories/camera.hpp:5, from /home/elsid/dev/openmw/components/settings/values.hpp:4, from /home/elsid/dev/openmw/apps/openmw/mwlua/luamanagerimp.cpp:16: /home/elsid/dev/openmw/components/settings/settingvalue.hpp:355:9: note: declared here 355 | SettingValue(const SettingValue& other) = delete; | ^~~~~~~~~~~~ --- apps/openmw/mwlua/luamanagerimp.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/apps/openmw/mwlua/luamanagerimp.cpp b/apps/openmw/mwlua/luamanagerimp.cpp index d34518d558..c324360287 100644 --- a/apps/openmw/mwlua/luamanagerimp.cpp +++ b/apps/openmw/mwlua/luamanagerimp.cpp @@ -123,8 +123,8 @@ namespace MWLua void LuaManager::update() { - if (Settings::lua().mGcStepsPerFrame > 0) - lua_gc(mLua.sol(), LUA_GCSTEP, Settings::lua().mGcStepsPerFrame); + if (const int steps = Settings::lua().mGcStepsPerFrame; steps > 0) + lua_gc(mLua.sol(), LUA_GCSTEP, steps); if (mPlayer.isEmpty()) return; // The game is not started yet.