1
0
Fork 0
mirror of https://github.com/OpenMW/openmw.git synced 2025-01-30 09:45:36 +00:00

Merge branch 'forurm' into 'master'

Add types.Actor.isDead

See merge request OpenMW/openmw!3557
This commit is contained in:
jvoisin 2023-11-05 16:35:09 +00:00
commit 44dc29e675
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