mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 10:31:42 +00:00
Add S_DigitalPlaying
This commit is contained in:
parent
47423a69ed
commit
44c7410a41
1 changed files with 16 additions and 0 deletions
|
@ -2325,6 +2325,21 @@ static int lib_sStopMusic(lua_State *L)
|
|||
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)
|
||||
{
|
||||
player_t *player = NULL;
|
||||
|
@ -2795,6 +2810,7 @@ static luaL_Reg lib[] = {
|
|||
{"S_PauseMusic",lib_sPauseMusic},
|
||||
{"S_ResumeMusic",lib_sResumeMusic},
|
||||
{"S_StopMusic",lib_sStopMusic},
|
||||
{"S_DigitalPlaying",lib_sDigitalPlaying},
|
||||
{"S_MidiPlaying",lib_sMidiPlaying},
|
||||
{"S_MusicPlaying",lib_sMusicPlaying},
|
||||
{"S_MusicPaused",lib_sMusicPaused},
|
||||
|
|
Loading…
Reference in a new issue