summaryrefslogtreecommitdiff
path: root/src/scriptapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r--src/scriptapi.cpp14
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