Skip to content

Commit 03f1702

Browse files
committed
Merge branch 'capacity' into 'master'
Lua: Expose capacity for creatures as well See merge request OpenMW/openmw!4481
2 parents e4cced0 + 81f2402 commit 03f1702

File tree

3 files changed

+11
-10
lines changed

3 files changed

+11
-10
lines changed

apps/openmw/mwlua/types/actor.cpp

+5
Original file line numberDiff line numberDiff line change
@@ -415,6 +415,11 @@ namespace MWLua
415415
return ptr.getClass().getEncumbrance(ptr);
416416
};
417417

418+
actor["getCapacity"] = [](const Object& actor) -> float {
419+
const MWWorld::Ptr ptr = actor.ptr();
420+
return ptr.getClass().getCapacity(ptr);
421+
};
422+
418423
addActorStatsBindings(actor, context);
419424
addActorMagicBindings(actor, context);
420425
}

apps/openmw/mwlua/types/npc.cpp

-4
Original file line numberDiff line numberDiff line change
@@ -353,9 +353,5 @@ namespace MWLua
353353

354354
return res;
355355
};
356-
npc["getCapacity"] = [](const Object& actor) -> float {
357-
const MWWorld::Ptr ptr = actor.ptr();
358-
return ptr.getClass().getCapacity(ptr);
359-
};
360356
}
361357
}

files/lua_api/openmw/types.lua

+6-6
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,12 @@
1515
-- @param openmw.core#GameObject actor
1616
-- @return #number
1717

18+
---
19+
-- Get the total weight that the actor can carry.
20+
-- @function [parent=#Actor] getCapacity
21+
-- @param openmw.core#GameObject actor
22+
-- @return #number
23+
1824
---
1925
-- Check if the given actor is dead (health reached 0, so death process started).
2026
-- @function [parent=#Actor] isDead
@@ -1035,12 +1041,6 @@
10351041
-- @param openmw.core#GameObject player The player that you want to modify the disposition for.
10361042
-- @param #number value Base disposition modification value
10371043

1038-
---
1039-
-- Get the total weight that the actor can carry.
1040-
-- @function [parent=#NPC] getCapacity
1041-
-- @param openmw.core#GameObject actor
1042-
-- @return #number
1043-
10441044
--- @{#Classes}: Class Data
10451045
-- @field [parent=#NPC] #Classes classes
10461046

0 commit comments

Comments
 (0)