Update l_server.cpp

This commit is contained in:
Ian Giestas Pauli 2017-01-27 22:22:12 -02:00 committed by GitHub
parent d8efe4a560
commit efaffa1b77
1 changed files with 21 additions and 0 deletions

View File

@ -429,6 +429,7 @@ int ModApiServer::l_sound_play(lua_State *L)
return 1;
}
// sound_stop(handle)
int ModApiServer::l_sound_stop(lua_State *L)
{
@ -438,6 +439,24 @@ int ModApiServer::l_sound_stop(lua_State *L)
return 0;
}
// sound_pause(handle)
int ModApiServer::l_sound_pause(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
int handle = luaL_checkinteger(L, 1);
getServer(L)->pauseSound(handle);
return 0;
}
// sound_resume(handle)
int ModApiServer::l_sound_resume(lua_State *L)
{
NO_MAP_LOCK_REQUIRED;
int handle = luaL_checkinteger(L, 1);
getServer(L)->resumeSound(handle);
return 0;
}
// is_singleplayer()
int ModApiServer::l_is_singleplayer(lua_State *L)
{
@ -531,6 +550,8 @@ void ModApiServer::Initialize(lua_State *L, int top)
API_FCT(show_formspec);
API_FCT(sound_play);
API_FCT(sound_stop);
API_FCT(sound_pause);
API_FCT(sound_resume);
API_FCT(get_player_information);
API_FCT(get_player_privs);