mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2026-04-26 03:51:50 +00:00
Lua: Added player_t input to S_DigitalPlaying, S_MidiPlaying, S_MusicPlaying, S_MusicPaused, S_MusicName
This commit is contained in:
parent
8d1b4ec54e
commit
2c4af751d2
1 changed files with 19 additions and 1 deletions
|
|
@ -2347,6 +2347,8 @@ static int lib_sDigitalPlaying(lua_State *L)
|
||||||
}
|
}
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
lua_pushboolean(L, !S_MIDIPlaying() && S_MusicPlaying());
|
lua_pushboolean(L, !S_MIDIPlaying() && S_MusicPlaying());
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2362,6 +2364,8 @@ static int lib_sMidiPlaying(lua_State *L)
|
||||||
}
|
}
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
lua_pushboolean(L, S_MIDIPlaying());
|
lua_pushboolean(L, S_MIDIPlaying());
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2377,6 +2381,8 @@ static int lib_sMusicPlaying(lua_State *L)
|
||||||
}
|
}
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
lua_pushboolean(L, S_MusicPlaying());
|
lua_pushboolean(L, S_MusicPlaying());
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2392,13 +2398,25 @@ static int lib_sMusicPaused(lua_State *L)
|
||||||
}
|
}
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
lua_pushboolean(L, S_MusicPaused());
|
lua_pushboolean(L, S_MusicPaused());
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
static int lib_sMusicName(lua_State *L)
|
static int lib_sMusicName(lua_State *L)
|
||||||
{
|
{
|
||||||
|
player_t *player = NULL;
|
||||||
NOHUD
|
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_pushstring(L, S_MusicName());
|
lua_pushstring(L, S_MusicName());
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue