From 123c65cb28ed3e7e572ed019403fee47e1aa67a5 Mon Sep 17 00:00:00 2001
From: yellowtd <ren_amon@hotmail.com>
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 d1bbf96e96..914ff16301 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 438d53b929..824a010c15 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
-- 
GitLab