summaryrefslogtreecommitdiff
path: root/src/scriptapi.cpp
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-12 13:59:56 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:39 +0200
commit38944467d31bbfa8a98008962f147cbc3c73f507 (patch)
treedc634dbc194a0742480d64c42231485f6b9e04e0 /src/scriptapi.cpp
parent23adfff4fea9c1ad49e7bc4cd08341c2e1fded78 (diff)
downloadminetest-38944467d31bbfa8a98008962f147cbc3c73f507.tar.gz
minetest-38944467d31bbfa8a98008962f147cbc3c73f507.tar.bz2
minetest-38944467d31bbfa8a98008962f147cbc3c73f507.zip
Scripting WIP
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;
}