[Lua] Add alias types.Container.inventory = types.Container.content

macos_ci_fix
Petr Mikheev 1 year ago
parent 84e71f4977
commit ac9facabf5

@ -28,15 +28,9 @@ namespace MWLua
void addContainerBindings(sol::table container, const Context& context)
{
container["content"] = sol::overload(
[](const LObject& o) {
containerPtr(o);
return Inventory<LObject>{ o };
},
[](const GObject& o) {
containerPtr(o);
return Inventory<GObject>{ o };
});
container["content"] = sol::overload([](const LObject& o) { return Inventory<LObject>{ o }; },
[](const GObject& o) { return Inventory<GObject>{ o }; });
container["inventory"] = container["content"];
container["encumbrance"] = [](const Object& obj) -> float {
const MWWorld::Ptr& ptr = containerPtr(obj);
return ptr.getClass().getEncumbrance(ptr);

@ -1440,7 +1440,9 @@
-- @param #ActivatorRecord activator A Lua table with the fields of a ActivatorRecord.
-- @return #ActivatorRecord A strongly typed Activator record.
--- @{#Container} functions
--------------------------------------------------------------------------------
-- @{#Container} functions
-- @field [parent=#types] #Container Container
---
@ -1455,6 +1457,12 @@
-- @param openmw.core#GameObject object
-- @return openmw.core#Inventory
---
-- Container content (same as `Container.content`, added for consistency with `Actor.inventory`).
-- @function [parent=#Container] inventory
-- @param openmw.core#GameObject object
-- @return openmw.core#Inventory
---
-- Whether the object is a Container.
-- @function [parent=#Container] objectIsInstance
@ -1487,7 +1495,9 @@
-- @field #string mwscript MWScript on this container (can be empty)
-- @field #number weight capacity of this container
--- @{#Door} functions
--------------------------------------------------------------------------------
-- @{#Door} functions
-- @field [parent=#types] #Door Door
---

Loading…
Cancel
Save