Add deprecation warnings for ObjectRef:get/set_attribute (#8443)
authorANAND <ClobberXD@gmail.com>
Sun, 7 Apr 2019 10:00:57 +0000 (15:30 +0530)
committerSmallJoker <SmallJoker@users.noreply.github.com>
Sun, 7 Apr 2019 10:00:57 +0000 (12:00 +0200)
src/script/lua_api/l_object.cpp

index b3ed39c7cb5230e5e6bf055d6f732e7ad7341d18..597cb84a8f91c16822e98031c61813f2726258fd 100644 (file)
@@ -1239,6 +1239,9 @@ int ObjectRef::l_get_breath(lua_State *L)
 // set_attribute(self, attribute, value)
 int ObjectRef::l_set_attribute(lua_State *L)
 {
+       log_deprecated(L,
+               "Deprecated call to set_attribute, use MetaDataRef methods instead.");
+
        ObjectRef *ref = checkobject(L, 1);
        PlayerSAO* co = getplayersao(ref);
        if (co == NULL)
@@ -1257,6 +1260,9 @@ int ObjectRef::l_set_attribute(lua_State *L)
 // get_attribute(self, attribute)
 int ObjectRef::l_get_attribute(lua_State *L)
 {
+       log_deprecated(L,
+               "Deprecated call to get_attribute, use MetaDataRef methods instead.");
+
        ObjectRef *ref = checkobject(L, 1);
        PlayerSAO* co = getplayersao(ref);
        if (co == NULL)