diff options
author | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-04-30 18:43:49 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-04-30 18:43:49 +0200 |
commit | ba91624d8c354bac49c35a449029b6712022d0cb (patch) | |
tree | 8a6423ab354888691927f852754f86816f9c90c5 /src/script/cpp_api/s_entity.h | |
parent | 0b5b32b026291d5bd8e47acebca10259a379fc1c (diff) | |
download | minetest-ba91624d8c354bac49c35a449029b6712022d0cb.tar.gz minetest-ba91624d8c354bac49c35a449029b6712022d0cb.tar.bz2 minetest-ba91624d8c354bac49c35a449029b6712022d0cb.zip |
Allow damage for attached objects, add attach/detach callbacks (#6786)
* Allow right-clicking on attached LuaEntities
Diffstat (limited to 'src/script/cpp_api/s_entity.h')
-rw-r--r-- | src/script/cpp_api/s_entity.h | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/script/cpp_api/s_entity.h b/src/script/cpp_api/s_entity.h index 173e24c30..966c2745e 100644 --- a/src/script/cpp_api/s_entity.h +++ b/src/script/cpp_api/s_entity.h @@ -41,6 +41,11 @@ public: ServerActiveObject *puncher, float time_from_last_punch, const ToolCapabilities *toolcap, v3f dir, s16 damage); bool luaentity_on_death(u16 id, ServerActiveObject *killer); - void luaentity_Rightclick(u16 id, - ServerActiveObject *clicker); + void luaentity_Rightclick(u16 id, ServerActiveObject *clicker); + void luaentity_on_attach_child(u16 id, ServerActiveObject *child); + void luaentity_on_detach_child(u16 id, ServerActiveObject *child); + void luaentity_on_detach(u16 id, ServerActiveObject *parent); +private: + bool luaentity_run_simple_callback(u16 id, ServerActiveObject *sao, + const char *field); }; |