mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-02-01 06:00:45 +00:00
Lua: Make S_SpeedMusic and S_ChangeMusic return nil for invalid players
This commit is contained in:
parent
c71719ac6b
commit
6bde90f887
1 changed files with 6 additions and 1 deletions
|
@ -2232,7 +2232,12 @@ static int lib_sChangeMusic(lua_State *L)
|
|||
music_flags = (UINT16)luaL_optinteger(L, 4, 0);
|
||||
|
||||
if (!player || P_IsLocalPlayer(player))
|
||||
{
|
||||
S_ChangeMusic(music_name, music_flags, looping);
|
||||
lua_pushboolean(L, true);
|
||||
}
|
||||
else
|
||||
lua_pushnil(L);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -2251,7 +2256,7 @@ static int lib_sSpeedMusic(lua_State *L)
|
|||
if (!player || P_IsLocalPlayer(player))
|
||||
lua_pushboolean(L, S_SpeedMusic(speed));
|
||||
else
|
||||
lua_pushboolean(L, false);
|
||||
lua_pushnil(L);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue