From 9e1a09114e8e91d67f26caf0e98d88982d796f0b Mon Sep 17 00:00:00 2001 From: yellowtd Date: Fri, 8 Aug 2014 22:05:44 -0400 Subject: [PATCH] S_music name variable access Quick edit to give lua scripts the ability to access internal name of the tunes added --- src/lua_infolib.c | 6 ++++++ src/sounds.h | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/lua_infolib.c b/src/lua_infolib.c index d1bbf96e9..914ff1630 100644 --- a/src/lua_infolib.c +++ b/src/lua_infolib.c @@ -945,6 +945,9 @@ static int musicinfo_get(lua_State *L) switch (field) { + case musicinfor_name: + lua_pushstring(L, music->name); + return 1; case musicinfor_dummyval: lua_pushinteger(L, music->dummyval); return 1; @@ -969,6 +972,9 @@ static int musicinfo_set(lua_State *L) switch (field) { + case musicinfow_name: + music->name = luaL_checkstring(L, 1); + break; case musicinfow_dummyval: music->dummyval = luaL_checkinteger(L, 1); break; diff --git a/src/sounds.h b/src/sounds.h index 438d53b92..824a010c1 100644 --- a/src/sounds.h +++ b/src/sounds.h @@ -119,7 +119,7 @@ extern musicinfo_t S_music[]; // Identifiers for all music in game. // -#define NUMMUSFREESLOTS 800 +#define NUMMUSFREESLOTS 256 // Music list (don't edit this comment!) typedef enum