1
0
mirror of https://gitlab.com/OpenMW/openmw.git synced 2025-01-27 03:35:27 +00:00

Add types.Actor.isDead

This commit is contained in:
Evil Eye 2023-11-02 19:29:26 +01:00
parent 3baefdf29e
commit 2d90176fe9
2 changed files with 11 additions and 0 deletions

View File

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

View File

@ -15,6 +15,12 @@
-- @param openmw.core#GameObject actor
-- @return #number
---
-- Check if the given actor is dead.
-- @function [parent=#Actor] isDead
-- @param openmw.core#GameObject actor
-- @return #boolean
---
-- Agent bounds to be used for pathfinding functions.
-- @function [parent=#Actor] getPathfindingAgentBounds