Merge branch 'public_next'

This commit is contained in:
mazmazz 2019-03-15 00:33:06 -04:00
commit 4377386153
5 changed files with 17 additions and 2 deletions

View file

@ -1162,6 +1162,9 @@ static void readlevelheader(MYFILE *f, INT32 num)
mapheaderinfo[num-1]->mustrack = ((UINT16)i - 1);
else if (fastcmp(word, "MUSICPOS"))
mapheaderinfo[num-1]->muspos = (UINT32)get_number(word2);
else if (fastcmp(word, "MUSICINTER"))
deh_strlcpy(mapheaderinfo[num-1]->musintername, word2,
sizeof(mapheaderinfo[num-1]->musintername), va("Level header %d: intermission music", num));
else if (fastcmp(word, "FORCECHARACTER"))
{
strlcpy(mapheaderinfo[num-1]->forcecharacter, word2, SKINNAMESIZE+1);

View file

@ -322,6 +322,9 @@ typedef struct
UINT8 numGradedMares; ///< Internal. For grade support.
nightsgrades_t *grades; ///< NiGHTS grades. Allocated dynamically for space reasons. Be careful.
// Music stuff.
char musintername[7]; ///< Intermission screen music.
// Lua stuff.
// (This is not ifdeffed so the map header structure can stay identical, just in case.)
UINT8 numCustomOptions; ///< Internal. For Lua custom value support.

View file

@ -2033,6 +2033,8 @@ static int mapheaderinfo_get(lua_State *L)
lua_pushinteger(L, header->mustrack);
else if (fastcmp(field,"muspos"))
lua_pushinteger(L, header->muspos);
else if (fastcmp(field,"musintername"))
lua_pushstring(L, header->musintername);
else if (fastcmp(field,"forcecharacter"))
lua_pushstring(L, header->forcecharacter);
else if (fastcmp(field,"weather"))

View file

@ -213,6 +213,7 @@ static void P_ClearSingleMapHeaderInfo(INT16 i)
mapheaderinfo[num]->musname[6] = 0;
mapheaderinfo[num]->mustrack = 0;
mapheaderinfo[num]->muspos = 0;
mapheaderinfo[num]->musintername[0] = '\0';
mapheaderinfo[num]->forcecharacter[0] = '\0';
mapheaderinfo[num]->weather = 0;
mapheaderinfo[num]->skynum = 1;

View file

@ -833,7 +833,10 @@ void Y_Ticker(void)
if (!intertic) // first time only
{
S_ChangeMusicInternal("_clear", false); // don't loop it
if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
else
S_ChangeMusicInternal("lclear", false); // don't loop it
tallydonetic = -1;
}
@ -898,7 +901,10 @@ void Y_Ticker(void)
if (!intertic) // first time only
{
S_ChangeMusicInternal("_clear", false); // don't loop it
if (mapheaderinfo[gamemap-1]->musintername[0] && S_MusicExists(mapheaderinfo[gamemap-1]->musintername, !midi_disabled, !digital_disabled))
S_ChangeMusicInternal(mapheaderinfo[gamemap-1]->musintername, false); // don't loop it
else
S_ChangeMusicInternal("lclear", false); // don't loop it
tallydonetic = -1;
}