aboutsummaryrefslogtreecommitdiff
path: root/src/script/lua_api/l_env.cpp
diff options
context:
space:
mode:
authorWeblate <42@minetest.ru>2013-06-21 10:24:16 +0200
committerWeblate <42@minetest.ru>2013-06-21 10:24:16 +0200
commit3af90db5b51da0c37f77fe6410e488c8c27acd67 (patch)
tree12edd6f0661b464e36863517241b5ec0b87b5ec1 /src/script/lua_api/l_env.cpp
parent58f3cd3eb598a7cf79983fe9e48c738591c6e004 (diff)
parentb1ebd9f79c63cf78b0e0fb2ea6f52d82cdfb95b6 (diff)
downloadminetest-3af90db5b51da0c37f77fe6410e488c8c27acd67.tar.gz
minetest-3af90db5b51da0c37f77fe6410e488c8c27acd67.tar.bz2
minetest-3af90db5b51da0c37f77fe6410e488c8c27acd67.zip
Merge remote-tracking branch 'origin/master'
Diffstat (limited to 'src/script/lua_api/l_env.cpp')
-rw-r--r--src/script/lua_api/l_env.cpp18
1 files changed, 10 insertions, 8 deletions
diff --git a/src/script/lua_api/l_env.cpp b/src/script/lua_api/l_env.cpp
index 58cf337ed..a287281a9 100644
--- a/src/script/lua_api/l_env.cpp
+++ b/src/script/lua_api/l_env.cpp
@@ -550,7 +550,7 @@ int ModApiEnvMod::l_line_of_sight(lua_State *L) {
GET_ENV_PTR;
// read position 1 from lua
- v3f pos1 = checkFloatPos(L, 2);
+ v3f pos1 = checkFloatPos(L, 1);
// read position 2 from lua
v3f pos2 = checkFloatPos(L, 2);
//read step size from lua
@@ -566,14 +566,14 @@ int ModApiEnvMod::l_find_path(lua_State *L)
{
GET_ENV_PTR;
- v3s16 pos1 = read_v3s16(L, 2);
- v3s16 pos2 = read_v3s16(L, 3);
- unsigned int searchdistance = luaL_checkint(L, 4);
- unsigned int max_jump = luaL_checkint(L, 5);
- unsigned int max_drop = luaL_checkint(L, 6);
+ v3s16 pos1 = read_v3s16(L, 1);
+ v3s16 pos2 = read_v3s16(L, 2);
+ unsigned int searchdistance = luaL_checkint(L, 3);
+ unsigned int max_jump = luaL_checkint(L, 4);
+ unsigned int max_drop = luaL_checkint(L, 5);
algorithm algo = A_PLAIN_NP;
- if(! lua_isnil(L, 7)) {
- std::string algorithm = luaL_checkstring(L,7);
+ if(! lua_isnil(L, 6)) {
+ std::string algorithm = luaL_checkstring(L,6);
if (algorithm == "A*")
algo = A_PLAIN;
@@ -680,6 +680,8 @@ bool ModApiEnvMod::Initialize(lua_State *L,int top)
retval &= API_FCT(get_perlin_map);
retval &= API_FCT(clear_objects);
retval &= API_FCT(spawn_tree);
+ retval &= API_FCT(find_path);
+ retval &= API_FCT(line_of_sight);
return retval;
}