Expose more mapheader stuff to Lua

This commit is contained in:
NepDisk 2026-04-17 11:51:23 -04:00
parent 4b50dd0ead
commit 0eea55d4b7

View file

@ -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!)