Expose more mapheader stuff to Lua
This commit is contained in:
parent
4b50dd0ead
commit
0eea55d4b7
1 changed files with 14 additions and 1 deletions
|
|
@ -10,6 +10,7 @@
|
|||
/// \file lua_maplib.c
|
||||
/// \brief game map library for Lua scripting
|
||||
|
||||
#include "blua/lua.h"
|
||||
#include "doomdef.h"
|
||||
#include "r_state.h"
|
||||
#include "p_local.h"
|
||||
|
|
@ -2546,7 +2547,13 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
{
|
||||
mapheader_t *header = *((mapheader_t **)luaL_checkudata(L, 1, META_MAPHEADER));
|
||||
const char *field = luaL_checkstring(L, 2);
|
||||
if (fastcmp(field,"lvlttl"))
|
||||
if (fastcmp(field,"lumpname"))
|
||||
lua_pushstring(L, header->lumpname);
|
||||
else if (fastcmp(field,"lumpnamehash"))
|
||||
lua_pushinteger(L, header->lumpnamehash);
|
||||
else if (fastcmp(field,"lumpnum"))
|
||||
lua_pushinteger(L, header->lumpnum);
|
||||
else if (fastcmp(field,"lvlttl"))
|
||||
lua_pushstring(L, header->lvlttl);
|
||||
else if (fastcmp(field,"subttl"))
|
||||
lua_pushstring(L, header->subttl);
|
||||
|
|
@ -2613,8 +2620,14 @@ static int mapheaderinfo_get(lua_State *L)
|
|||
lua_pushinteger(L, header->menuflags);
|
||||
else if (fastcmp(field,"mobj_scale"))
|
||||
lua_pushfixed(L, header->mobj_scale);
|
||||
else if (fastcmp(field,"default_waypoint_radius"))
|
||||
lua_pushfixed(L, header->default_waypoint_radius);
|
||||
else if (fastcmp(field, "gravity"))
|
||||
lua_pushfixed(L, header->gravity);
|
||||
else if (fastcmp(field, "use_walltransfer"))
|
||||
lua_pushboolean(L, header->use_walltransfer);
|
||||
else if (fastcmp(field, "use_terrain"))
|
||||
lua_pushboolean(L, header->use_terrain);
|
||||
else {
|
||||
// Read custom vars now
|
||||
// (note: don't include the "LUA." in your lua scripts!)
|
||||
|
|
|
|||
Loading…
Reference in a new issue