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

Lua templating reading (part 4): s16, v2s16, v2f (#7512)

This commit is contained in:
Loïc Blot 2018-07-08 23:06:33 +02:00 committed by GitHub
parent 94cd2bfeac
commit a61e1a4dbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
5 changed files with 61 additions and 24 deletions

View file

@ -113,21 +113,6 @@ v2s16 read_v2s16(lua_State *L, int index)
return p;
}
v2s16 check_v2s16(lua_State *L, int index)
{
v2s16 p;
CHECK_POS_TAB(index);
lua_getfield(L, index, "x");
CHECK_POS_COORD("x");
p.X = lua_tonumber(L, -1);
lua_pop(L, 1);
lua_getfield(L, index, "y");
CHECK_POS_COORD("y");
p.Y = lua_tonumber(L, -1);
lua_pop(L, 1);
return p;
}
void push_v2s16(lua_State *L, v2s16 p)
{
lua_newtable(L);