From b5acec0a3c5701c53854ff7afdf4008863e6e8df Mon Sep 17 00:00:00 2001 From: sapier Date: Tue, 29 Apr 2014 17:47:34 +0200 Subject: Add proper lua api deprecated handling --- src/script/lua_api/l_object.cpp | 1 + src/script/lua_api/l_particles.cpp | 2 ++ src/script/lua_api/l_util.cpp | 5 +++++ 3 files changed, 8 insertions(+) (limited to 'src/script/lua_api') diff --git a/src/script/lua_api/l_object.cpp b/src/script/lua_api/l_object.cpp index 5e3ddd235..30d423e6a 100644 --- a/src/script/lua_api/l_object.cpp +++ b/src/script/lua_api/l_object.cpp @@ -659,6 +659,7 @@ int ObjectRef::l_get_entity_name(lua_State *L) NO_MAP_LOCK_REQUIRED; ObjectRef *ref = checkobject(L, 1); LuaEntitySAO *co = getluaobject(ref); + log_deprecated(L,"Deprecated call to \"get_entity_name"); if(co == NULL) return 0; // Do it std::string name = co->getName(); diff --git a/src/script/lua_api/l_particles.cpp b/src/script/lua_api/l_particles.cpp index 088eba06e..6769f5c23 100644 --- a/src/script/lua_api/l_particles.cpp +++ b/src/script/lua_api/l_particles.cpp @@ -44,6 +44,7 @@ int ModApiParticles::l_add_particle(lua_State *L) if (lua_gettop(L) > 1) // deprecated { + log_deprecated(L,"Deprecated add_particle call with individual parameters instead of definition"); pos = check_v3f(L, 1); vel = check_v3f(L, 2); acc = check_v3f(L, 3); @@ -128,6 +129,7 @@ int ModApiParticles::l_add_particlespawner(lua_State *L) if (lua_gettop(L) > 1) //deprecated { + log_deprecated(L,"Deprecated add_particlespawner call with individual parameters instead of definition"); amount = luaL_checknumber(L, 1); time = luaL_checknumber(L, 2); minpos = check_v3f(L, 3); diff --git a/src/script/lua_api/l_util.cpp b/src/script/lua_api/l_util.cpp index 90a1d77ab..7babaaf71 100644 --- a/src/script/lua_api/l_util.cpp +++ b/src/script/lua_api/l_util.cpp @@ -78,6 +78,11 @@ int ModApiUtil::l_log(lua_State *L) level = LMT_ACTION; else if(levelname == "verbose") level = LMT_VERBOSE; + else if (levelname == "deprecated") { + log_deprecated(L,text); + return 0; + } + } log_printline(level, text); return 0; -- cgit v1.2.3