diff options
author | Perttu Ahola <celeron55@gmail.com> | 2012-03-09 20:46:56 +0200 |
---|---|---|
committer | Perttu Ahola <celeron55@gmail.com> | 2012-03-10 11:28:13 +0200 |
commit | 8db89b8136686a5721080d18e8a14f03404aa095 (patch) | |
tree | a6a87bc6a50b9ab2030930faae35ed22814c7669 /src/scriptapi.cpp | |
parent | 8c01ad8a9da86fc76bc9a180ccab10ede726625a (diff) | |
download | hax-minetest-server-8db89b8136686a5721080d18e8a14f03404aa095.tar.gz hax-minetest-server-8db89b8136686a5721080d18e8a14f03404aa095.zip |
LuaEntity armor groups
Diffstat (limited to '')
-rw-r--r-- | src/scriptapi.cpp | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp index c3059ec55..541baa61c 100644 --- a/src/scriptapi.cpp +++ b/src/scriptapi.cpp @@ -2538,6 +2538,19 @@ private: return 0; } + // set_armor_groups(self, groups) + static int l_set_armor_groups(lua_State *L) + { + ObjectRef *ref = checkobject(L, 1); + LuaEntitySAO *co = getluaobject(ref); + if(co == NULL) return 0; + // Do it + ItemGroupList groups; + read_groups(L, 2, groups); + co->setArmorGroups(groups); + return 0; + } + // DEPRECATED // get_entity_name(self) static int l_get_entity_name(lua_State *L) @@ -2700,6 +2713,7 @@ const luaL_reg ObjectRef::methods[] = { method(ObjectRef, getyaw), method(ObjectRef, settexturemod), method(ObjectRef, setsprite), + method(ObjectRef, set_armor_groups), method(ObjectRef, get_entity_name), method(ObjectRef, get_luaentity), // Player-only |