Add Lua support for vertex heights.

This commit is contained in:
Nev3r 2020-01-04 11:38:23 +01:00
parent 42bbad4810
commit 1d5b435de1

View file

@ -158,7 +158,11 @@ enum vertex_e {
vertex_valid = 0, vertex_valid = 0,
vertex_x, vertex_x,
vertex_y, vertex_y,
vertex_z vertex_z,
vertex_floorz,
vertex_floorzset,
vertex_ceilingz,
vertex_ceilingzset
}; };
static const char *const vertex_opt[] = { static const char *const vertex_opt[] = {
@ -166,6 +170,10 @@ static const char *const vertex_opt[] = {
"x", "x",
"y", "y",
"z", "z",
"floorz",
"floorzset",
"ceilingz",
"ceilingzset",
NULL}; NULL};
enum ffloor_e { enum ffloor_e {
@ -973,6 +981,18 @@ static int vertex_get(lua_State *L)
case vertex_z: case vertex_z:
lua_pushfixed(L, vertex->z); lua_pushfixed(L, vertex->z);
return 1; return 1;
case vertex_floorzset:
lua_pushboolean(L, vertex->floorzset);
return 1;
case vertex_ceilingzset:
lua_pushboolean(L, vertex->ceilingzset);
return 1;
case vertex_floorz:
lua_pushfixed(L, vertex->floorz);
return 1;
case vertex_ceilingz:
lua_pushfixed(L, vertex->ceilingz);
return 1;
} }
return 0; return 0;
} }