diff --git a/apps/openmw/mwlua/types/actor.cpp b/apps/openmw/mwlua/types/actor.cpp index 02686684e8..413a656e90 100644 --- a/apps/openmw/mwlua/types/actor.cpp +++ b/apps/openmw/mwlua/types/actor.cpp @@ -415,6 +415,11 @@ namespace MWLua return ptr.getClass().getEncumbrance(ptr); }; + actor["getCapacity"] = [](const Object& actor) -> float { + const MWWorld::Ptr ptr = actor.ptr(); + return ptr.getClass().getCapacity(ptr); + }; + addActorStatsBindings(actor, context); addActorMagicBindings(actor, context); } diff --git a/apps/openmw/mwlua/types/npc.cpp b/apps/openmw/mwlua/types/npc.cpp index 7cfcf6d704..e649c56a0f 100644 --- a/apps/openmw/mwlua/types/npc.cpp +++ b/apps/openmw/mwlua/types/npc.cpp @@ -353,9 +353,5 @@ namespace MWLua return res; }; - npc["getCapacity"] = [](const Object& actor) -> float { - const MWWorld::Ptr ptr = actor.ptr(); - return ptr.getClass().getCapacity(ptr); - }; } } diff --git a/files/lua_api/openmw/types.lua b/files/lua_api/openmw/types.lua index e518723ea5..e1b814f8b3 100644 --- a/files/lua_api/openmw/types.lua +++ b/files/lua_api/openmw/types.lua @@ -15,6 +15,12 @@ -- @param openmw.core#GameObject actor -- @return #number +--- +-- Get the total weight that the actor can carry. +-- @function [parent=#Actor] getCapacity +-- @param openmw.core#GameObject actor +-- @return #number + --- -- Check if the given actor is dead (health reached 0, so death process started). -- @function [parent=#Actor] isDead @@ -1035,12 +1041,6 @@ -- @param openmw.core#GameObject player The player that you want to modify the disposition for. -- @param #number value Base disposition modification value ---- --- Get the total weight that the actor can carry. --- @function [parent=#NPC] getCapacity --- @param openmw.core#GameObject actor --- @return #number - --- @{#Classes}: Class Data -- @field [parent=#NPC] #Classes classes