mirror of
https://github.com/KartKrewDev/RingRacers.git
synced 2025-10-30 08:01:28 +00:00
Lua: Make S_SpeedMusic and S_ChangeMusic return nil for invalid players
This commit is contained in:
parent
8e087a04b4
commit
2e3837e656
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);
|
music_flags = (UINT16)luaL_optinteger(L, 4, 0);
|
||||||
|
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
|
{
|
||||||
S_ChangeMusic(music_name, music_flags, looping);
|
S_ChangeMusic(music_name, music_flags, looping);
|
||||||
|
lua_pushboolean(L, true);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
lua_pushnil(L);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -2251,7 +2256,7 @@ static int lib_sSpeedMusic(lua_State *L)
|
||||||
if (!player || P_IsLocalPlayer(player))
|
if (!player || P_IsLocalPlayer(player))
|
||||||
lua_pushboolean(L, S_SpeedMusic(speed));
|
lua_pushboolean(L, S_SpeedMusic(speed));
|
||||||
else
|
else
|
||||||
lua_pushboolean(L, false);
|
lua_pushnil(L);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue