summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPerttu Ahola <celeron55@gmail.com>2011-11-21 14:56:03 +0200
committerPerttu Ahola <celeron55@gmail.com>2011-11-29 19:13:50 +0200
commit0bf3a15886ec881e77d7753d02e9ac76e401bdd9 (patch)
treecfda3608b6f54e8fc9ed4a4db5f45e347f5d22a6 /src
parentcebc8c78a4f5c4a2d7bb246e44f7bd2599de9c9b (diff)
downloadminetest-0bf3a15886ec881e77d7753d02e9ac76e401bdd9.tar.gz
minetest-0bf3a15886ec881e77d7753d02e9ac76e401bdd9.tar.bz2
minetest-0bf3a15886ec881e77d7753d02e9ac76e401bdd9.zip
Random Lua tweaks/fixes
Diffstat (limited to 'src')
-rw-r--r--src/scriptapi.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/scriptapi.cpp b/src/scriptapi.cpp
index 02db2ce02..459719632 100644
--- a/src/scriptapi.cpp
+++ b/src/scriptapi.cpp
@@ -154,14 +154,17 @@ static void pushpos(lua_State *L, v3s16 p)
static v3s16 readpos(lua_State *L, int index)
{
- v3s16 p;
+ // Correct rounding at <0
+ v3f pf = readFloatPos(L, index);
+ return floatToInt(pf, BS);
+ /*v3s16 p;
lua_getfield(L, index, "x");
p.X = lua_tonumber(L, -1);
lua_getfield(L, index, "y");
p.Y = lua_tonumber(L, -1);
lua_getfield(L, index, "z");
p.Z = lua_tonumber(L, -1);
- return p;
+ return p;*/
}
static void pushnode(lua_State *L, const MapNode &n, INodeDefManager *ndef)