From 448e05ade927984ed8c6a7299b9c47c69282e202 Mon Sep 17 00:00:00 2001 From: crabman77 Date: Fri, 25 Sep 2015 15:30:10 +0200 Subject: [PATCH] fix crash --- mods/soundset/init.lua | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mods/soundset/init.lua b/mods/soundset/init.lua index d0dce09b..7b7e48b9 100755 --- a/mods/soundset/init.lua +++ b/mods/soundset/init.lua @@ -129,10 +129,10 @@ end minetest.register_on_player_receive_fields(function(player, formname, fields) if formname == "soundset:settings" then local name = player:get_player_name() - if not name then return end - local fmusic = soundset.tmp[name]["music"] - local fambience = soundset.tmp[name]["ambience"] - local fother = soundset.tmp[name]["other"] + if not name or name == "" then return end + local fmusic = soundset.tmp[name]["music"] or 50 + local fambience = soundset.tmp[name]["ambience"] or 50 + local fother = soundset.tmp[name]["other"] or 50 if fields["abort"] == "Ok" 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