summaryrefslogtreecommitdiffstats
path: root/src/Bindings/DeprecatedBindings.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/Bindings/DeprecatedBindings.cpp')
-rw-r--r--src/Bindings/DeprecatedBindings.cpp46
1 files changed, 46 insertions, 0 deletions
diff --git a/src/Bindings/DeprecatedBindings.cpp b/src/Bindings/DeprecatedBindings.cpp
index 0ffc58cbb..029d4edb7 100644
--- a/src/Bindings/DeprecatedBindings.cpp
+++ b/src/Bindings/DeprecatedBindings.cpp
@@ -10,6 +10,7 @@
#include "../World.h"
#include "../Entities/Player.h"
#include "LuaState.h"
+#include "../Tracer.h"
@@ -291,6 +292,47 @@ tolua_lerror:
+/* method: Trace of class cTracer */
+static int tolua_cTracer_Trace(lua_State * a_LuaState)
+{
+ // Log a deprecation warning with stacktrace:
+ cLuaState S(a_LuaState);
+ LOGWARNING("The function cTracer:Trace is obsolete, use the cLineBlockTracer instead");
+ S.LogStackTrace();
+
+ // Check params:
+ if (
+ !S.CheckParamUserType(1, "cTracer") ||
+ !S.CheckParamUserType(2, "const Vector3<float>", 3) ||
+ !S.CheckParamNumber (4)
+ )
+ {
+ return 0;
+ }
+
+ // Read params:
+ cTracer * self;
+ Vector3d * start;
+ Vector3d * direction;
+ int distance;
+ bool lineOfSight = false;
+ if (!S.GetStackValues(1, self, start, direction, distance))
+ {
+ LOGWARNING("Cannot retrieve parameters for cTracer::Trace. Expected a cTracer (self), Vector3d, Vector3d, number and optional boolean.");
+ S.LogStackValues();
+ return 0;
+ }
+ S.GetStackValue(5, lineOfSight);
+
+ // Call and push the result:
+ S.Push(self->Trace(*start, *direction, distance, lineOfSight));
+ return 1;
+}
+
+
+
+
+
/** function: cWorld:SetSignLines */
static int tolua_cWorld_SetSignLines(lua_State * tolua_S)
{
@@ -398,6 +440,10 @@ void DeprecatedBindings::Bind(lua_State * tolua_S)
tolua_function(tolua_S, "StringToMobType", tolua_AllToLua_StringToMobType00);
+ tolua_beginmodule(tolua_S, "cTracer");
+ tolua_function(tolua_S, "Trace", tolua_cTracer_Trace);
+ tolua_endmodule(tolua_S);
+
tolua_beginmodule(tolua_S, "cWorld");
tolua_function(tolua_S, "UpdateSign", tolua_cWorld_SetSignLines);
tolua_endmodule(tolua_S);