mirror of
https://github.com/OpenMW/openmw.git
synced 2025-06-20 17:41:33 +00:00
Add types.Actor.isDead
This commit is contained in:
parent
3baefdf29e
commit
2d90176fe9
2 changed files with 11 additions and 0 deletions
|
@ -395,6 +395,11 @@ namespace MWLua
|
||||||
return dist <= actorsProcessingRange;
|
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 {
|
actor["getEncumbrance"] = [](const Object& actor) -> float {
|
||||||
const MWWorld::Ptr ptr = actor.ptr();
|
const MWWorld::Ptr ptr = actor.ptr();
|
||||||
return ptr.getClass().getEncumbrance(ptr);
|
return ptr.getClass().getEncumbrance(ptr);
|
||||||
|
|
|
@ -15,6 +15,12 @@
|
||||||
-- @param openmw.core#GameObject actor
|
-- @param openmw.core#GameObject actor
|
||||||
-- @return #number
|
-- @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.
|
-- Agent bounds to be used for pathfinding functions.
|
||||||
-- @function [parent=#Actor] getPathfindingAgentBounds
|
-- @function [parent=#Actor] getPathfindingAgentBounds
|
||||||
|
|
Loading…
Reference in a new issue