1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-16 15:30:30 +01:00

fix crash

This commit is contained in:
crabman77 2015-09-25 15:30:10 +02:00
parent 6bf996798a
commit 448e05ade9

View File

@ -129,10 +129,10 @@ end
minetest.register_on_player_receive_fields(function(player, formname, fields) minetest.register_on_player_receive_fields(function(player, formname, fields)
if formname == "soundset:settings" then if formname == "soundset:settings" then
local name = player:get_player_name() local name = player:get_player_name()
if not name then return end if not name or name == "" then return end
local fmusic = soundset.tmp[name]["music"] local fmusic = soundset.tmp[name]["music"] or 50
local fambience = soundset.tmp[name]["ambience"] local fambience = soundset.tmp[name]["ambience"] or 50
local fother = soundset.tmp[name]["other"] local fother = soundset.tmp[name]["other"] or 50
if fields["abort"] == "Ok" then if fields["abort"] == "Ok" then
if soundset.gainplayers[name]["music"] ~= fmusic or soundset.gainplayers[name]["ambience"] ~= fambience or soundset.gainplayers[name]["other"] ~= fother then if soundset.gainplayers[name]["music"] ~= fmusic or soundset.gainplayers[name]["ambience"] ~= fambience or soundset.gainplayers[name]["other"] ~= fother then
soundset.gainplayers[name]["music"] = fmusic soundset.gainplayers[name]["music"] = fmusic