Add Lua support for vertex heights.

This commit is contained in:
Nev3r 2020-01-04 11:38:23 +01:00
parent 60999c7b84
commit f207048ab2

View file

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