mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Use integers instead of float values
This commit is contained in:
parent
c0ab09af74
commit
8b02a015eb
9 changed files with 71 additions and 42 deletions
|
@ -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;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue