summaryrefslogtreecommitdiff
path: root/src/scriptapi.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/scriptapi.cpp')
-rw-r--r--src/scriptapi.cpp17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index dc9c832d2..428810117 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -367,7 +367,8 @@ private:
}
// Exported functions
-
+
+ // remove(self)
static int l_remove(lua_State *L)
{
ObjectRef *ref = checkobject(L, 1);
@@ -377,7 +378,9 @@ private:
co->m_removed = true;
return 0;
}
-
+
+ // getpos(self)
+ // returns: {x=num, y=num, z=num}
static int l_getpos(lua_State *L)
{
ObjectRef *ref = checkobject(L, 1);
@@ -393,7 +396,8 @@ private:
lua_setfield(L, -2, "z");
return 1;
}
-
+
+ // setpos(self, pos)
static int l_setpos(lua_State *L)
{
ObjectRef *ref = checkobject(L, 1);
@@ -406,7 +410,8 @@ private:
co->setPos(pos);
return 0;
}
-
+
+ // moveto(self, pos, continuous=false)
static int l_moveto(lua_State *L)
{
ObjectRef *ref = checkobject(L, 1);
@@ -415,8 +420,10 @@ private:
if(co == NULL) return 0;
// pos
v3f pos = readFloatPos(L, 2);
+ // continuous
+ bool continuous = lua_toboolean(L, 3);
// Do it
- co->moveTo(pos);
+ co->moveTo(pos, continuous);
return 0;
}