From 823dc6a8969f05d59e40b2c9b623b2117370ab20 Mon Sep 17 00:00:00 2001 From: Evil Eye Date: Thu, 23 Oct 2025 20:51:01 +0200 Subject: [PATCH] Return type as a sol::object instead of a table proxy --- apps/openmw/mwlua/objectbindings.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwlua/objectbindings.cpp b/apps/openmw/mwlua/objectbindings.cpp index 2a0aa87d15..ace9722bbe 100644 --- a/apps/openmw/mwlua/objectbindings.cpp +++ b/apps/openmw/mwlua/objectbindings.cpp @@ -330,10 +330,9 @@ namespace MWLua return LuaUtil::Box{ bb.center(), bb._max - bb.center() }; }; - objectT["type"] - = sol::readonly_property([types = getTypeToPackageTable(context.sol())](const ObjectT& o) mutable { - return types[getLiveCellRefType(o.ptr().mRef)]; - }); + objectT["type"] = sol::readonly_property( + [types = getTypeToPackageTable(context.sol())]( + const ObjectT& o) -> sol::object { return types[getLiveCellRefType(o.ptr().mRef)]; }); objectT["count"] = sol::readonly_property([](const ObjectT& o) { return o.ptr().getCellRef().getCount(); }); objectT[sol::meta_function::equal_to] = [](const ObjectT& a, const ObjectT& b) { return a.id() == b.id(); };