Add S_DigitalPlaying

This commit is contained in:
mazmazz 2018-01-15 08:08:05 -05:00
parent 47423a69ed
commit 44c7410a41

View file

@ -2325,6 +2325,21 @@ static int lib_sStopMusic(lua_State *L)
return 0; return 0;
} }
static int lib_sDigitalPlaying(lua_State *L)
{
player_t *player = NULL;
NOHUD
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
{
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
if (!player)
return LUA_ErrInvalid(L, "player_t");
}
if (!player || P_IsLocalPlayer(player))
lua_pushboolean(L, !S_MIDIPlaying() && S_MusicPlaying());
return 1;
}
static int lib_sMidiPlaying(lua_State *L) static int lib_sMidiPlaying(lua_State *L)
{ {
player_t *player = NULL; player_t *player = NULL;
@ -2795,6 +2810,7 @@ static luaL_Reg lib[] = {
{"S_PauseMusic",lib_sPauseMusic}, {"S_PauseMusic",lib_sPauseMusic},
{"S_ResumeMusic",lib_sResumeMusic}, {"S_ResumeMusic",lib_sResumeMusic},
{"S_StopMusic",lib_sStopMusic}, {"S_StopMusic",lib_sStopMusic},
{"S_DigitalPlaying",lib_sDigitalPlaying},
{"S_MidiPlaying",lib_sMidiPlaying}, {"S_MidiPlaying",lib_sMidiPlaying},
{"S_MusicPlaying",lib_sMusicPlaying}, {"S_MusicPlaying",lib_sMusicPlaying},
{"S_MusicPaused",lib_sMusicPaused}, {"S_MusicPaused",lib_sMusicPaused},