summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEvil Eye <malusluminis@hotmail.com>2024-02-24 10:31:15 +0000
committerEvil Eye <malusluminis@hotmail.com>2024-02-24 10:31:15 +0000
commit595e42ae43944bed3fd2ee91d35345cc0f40f923 (patch)
tree6506dca924dbac7a1f458930f5e04a61534d090f
parent82c92a9a6c9bfec67d35d24cb6879e72467810ee (diff)
parent7c4b42ab2a7cee4eec39fabf7ba8a95c2c735da0 (diff)
Merge branch 'lua_death_finished' into 'master'
Add a Lua function to check if actor's death is finished See merge request OpenMW/openmw!3901
-rw-r--r--CMakeLists.txt2
-rw-r--r--apps/openmw/mwlua/types/actor.cpp5
-rw-r--r--files/lua_api/openmw/types.lua8
3 files changed, 13 insertions, 2 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index d1ad7fa387..76aede04c9 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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 "")
diff --git a/apps/openmw/mwlua/types/actor.cpp b/apps/openmw/mwlua/types/actor.cpp
index 4fda04e7c5..3b0142e441 100644
--- a/apps/openmw/mwlua/types/actor.cpp
+++ b/apps/openmw/mwlua/types/actor.cpp
@@ -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);
diff --git a/files/lua_api/openmw/types.lua b/files/lua_api/openmw/types.lua
index a7f57d3a6c..0c51544f64 100644
--- a/files/lua_api/openmw/types.lua
+++ b/files/lua_api/openmw/types.lua
@@ -16,12 +16,18 @@
-- @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
-- @param openmw.core#GameObject actor