1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-03-27 05:10:26 +00:00

Add baseCount

This commit is contained in:
Zackhasacat 2023-08-27 20:47:43 -05:00
parent 518aa5c6ae
commit 84987450ee
2 changed files with 3 additions and 0 deletions

View file

@ -214,6 +214,8 @@ namespace MWLua
const ObjectT& o) mutable { return types[getLiveCellRefType(o.ptr().mRef)]; }); const ObjectT& o) mutable { return types[getLiveCellRefType(o.ptr().mRef)]; });
objectT["count"] = sol::readonly_property([](const ObjectT& o) { return o.ptr().getRefData().getCount(); }); objectT["count"] = sol::readonly_property([](const ObjectT& o) { return o.ptr().getRefData().getCount(); });
objectT["baseCount"]
= sol::readonly_property([](const ObjectT& o) { return o.ptr().getRefData().getCount(false); });
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(); };
objectT[sol::meta_function::to_string] = &ObjectT::toString; objectT[sol::meta_function::to_string] = &ObjectT::toString;
objectT["sendEvent"] = [context](const ObjectT& dest, std::string eventName, const sol::object& eventData) { objectT["sendEvent"] = [context](const ObjectT& dest, std::string eventName, const sol::object& eventData) {

View file

@ -161,6 +161,7 @@
-- @field #Cell cell The cell where the object currently is. During loading a game and for objects in an inventory or a container `cell` is nil. -- @field #Cell cell The cell where the object currently is. During loading a game and for objects in an inventory or a container `cell` is nil.
-- @field #any type Type of the object (one of the tables from the package @{openmw.types#types}). -- @field #any type Type of the object (one of the tables from the package @{openmw.types#types}).
-- @field #number count Count (>1 means a stack of objects). -- @field #number count Count (>1 means a stack of objects).
-- @field #number baseCount Base Count (<1 means a restocking item).
-- @field #string recordId Returns record ID of the object in lowercase. -- @field #string recordId Returns record ID of the object in lowercase.
--- ---