mirror of
https://github.com/OpenMW/openmw.git
synced 2025-11-01 19:56:38 +00:00
Return type as a sol::object instead of a table proxy
This commit is contained in:
parent
2e67c8b47f
commit
823dc6a896
1 changed files with 3 additions and 4 deletions
|
|
@ -330,10 +330,9 @@ namespace MWLua
|
||||||
return LuaUtil::Box{ bb.center(), bb._max - bb.center() };
|
return LuaUtil::Box{ bb.center(), bb._max - bb.center() };
|
||||||
};
|
};
|
||||||
|
|
||||||
objectT["type"]
|
objectT["type"] = sol::readonly_property(
|
||||||
= sol::readonly_property([types = getTypeToPackageTable(context.sol())](const ObjectT& o) mutable {
|
[types = getTypeToPackageTable(context.sol())](
|
||||||
return types[getLiveCellRefType(o.ptr().mRef)];
|
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["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(); };
|
objectT[sol::meta_function::equal_to] = [](const ObjectT& a, const ObjectT& b) { return a.id() == b.id(); };
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue