mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2024-11-18 18:41:57 +00:00
Add player parameter to S_GetMusicPosition lua
# Conflicts: # src/lua_baselib.c
This commit is contained in:
parent
e0ab8c1ed0
commit
95e4d0d423
1 changed files with 10 additions and 0 deletions
|
@ -2292,6 +2292,8 @@ static int lib_sPauseMusic(lua_State *L)
|
||||||
}
|
}
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
S_PauseAudio();
|
S_PauseAudio();
|
||||||
|
else
|
||||||
|
lua_pushboolean(L, false);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2302,11 +2304,19 @@ static int lib_sResumeMusic(lua_State *L)
|
||||||
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
|
if (!lua_isnone(L, 1) && lua_isuserdata(L, 1))
|
||||||
{
|
{
|
||||||
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
player = *((player_t **)luaL_checkudata(L, 1, META_PLAYER));
|
||||||
|
UINT32 position = (UINT32)luaL_checkinteger(L, 1);
|
||||||
|
player_t *player = NULL;
|
||||||
|
NOHUD
|
||||||
|
if (!lua_isnone(L, 2) && lua_isuserdata(L, 2))
|
||||||
|
{
|
||||||
|
player = *((player_t **)luaL_checkudata(L, 2, META_PLAYER));
|
||||||
if (!player)
|
if (!player)
|
||||||
return LUA_ErrInvalid(L, "player_t");
|
return LUA_ErrInvalid(L, "player_t");
|
||||||
}
|
}
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
S_ResumeAudio();
|
S_ResumeAudio();
|
||||||
|
else
|
||||||
|
lua_pushboolean(L, false);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue