1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-06-27 16:36:03 +00:00

Random Lua tweaks/fixes

This commit is contained in:
Perttu Ahola 2011-11-21 14:56:03 +02:00
parent cebc8c78a4
commit 0bf3a15886
2 changed files with 9 additions and 6 deletions

View file

@ -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)