Add a Lua function to check if actor's death is finished

fix-osga-rotate-wildly
Andrei Kortunov 10 months ago
parent 35f547ad7c
commit 7c4b42ab2a

@ -80,7 +80,7 @@ message(STATUS "Configuring OpenMW...")
set(OPENMW_VERSION_MAJOR 0)
set(OPENMW_VERSION_MINOR 49)
set(OPENMW_VERSION_RELEASE 0)
set(OPENMW_LUA_API_REVISION 54)
set(OPENMW_LUA_API_REVISION 55)
set(OPENMW_POSTPROCESSING_API_REVISION 1)
set(OPENMW_VERSION_COMMITHASH "")

@ -403,6 +403,11 @@ namespace MWLua
return target.getClass().getCreatureStats(target).isDead();
};
actor["isDeathFinished"] = [](const Object& o) {
const auto& target = o.ptr();
return target.getClass().getCreatureStats(target).isDeathAnimationFinished();
};
actor["getEncumbrance"] = [](const Object& actor) -> float {
const MWWorld::Ptr ptr = actor.ptr();
return ptr.getClass().getEncumbrance(ptr);

@ -16,11 +16,17 @@
-- @return #number
---
-- Check if the given actor is dead.
-- Check if the given actor is dead (health reached 0, so death process started).
-- @function [parent=#Actor] isDead
-- @param openmw.core#GameObject actor
-- @return #boolean
---
-- Check if the given actor's death process is finished.
-- @function [parent=#Actor] isDeathFinished
-- @param openmw.core#GameObject actor
-- @return #boolean
---
-- Agent bounds to be used for pathfinding functions.
-- @function [parent=#Actor] getPathfindingAgentBounds

Loading…
Cancel
Save