summaryrefslogtreecommitdiff
path: root/src/script/common/c_converter.cpp
diff options
context:
space:
mode:
authorBlockMen <nmuelll@web.de>2014-04-12 13:50:22 +0200
committerBlockMen <nmuelll@web.de>2014-04-12 20:04:12 +0200
commit8b02a015eb7630c25e255ffe400bb714d023609b (patch)
tree42a7d9bd217a04574767f9c202536bdebafa53c3 /src/script/common/c_converter.cpp
parentc0ab09af747fc431dfb459ede30788cb9cd1c56b (diff)
downloadminetest-8b02a015eb7630c25e255ffe400bb714d023609b.tar.gz
minetest-8b02a015eb7630c25e255ffe400bb714d023609b.tar.bz2
minetest-8b02a015eb7630c25e255ffe400bb714d023609b.zip
Use integers instead of float values
Diffstat (limited to 'src/script/common/c_converter.cpp')
-rw-r--r--src/script/common/c_converter.cpp13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/script/common/c_converter.cpp b/src/script/common/c_converter.cpp
index df86f2daf..b2ef0573c 100644
--- a/src/script/common/c_converter.cpp
+++ b/src/script/common/c_converter.cpp
@@ -59,6 +59,19 @@ v2s16 read_v2s16(lua_State *L, int index)
return p;
}
+v2s32 read_v2s32(lua_State *L, int index)
+{
+ v2s32 p;
+ luaL_checktype(L, index, LUA_TTABLE);
+ lua_getfield(L, index, "x");
+ p.X = lua_tonumber(L, -1);
+ lua_pop(L, 1);
+ lua_getfield(L, index, "y");
+ p.Y = lua_tonumber(L, -1);
+ lua_pop(L, 1);
+ return p;
+}
+
v2f read_v2f(lua_State *L, int index)
{
v2f p;