diff options
author | Wuzzy <almikes@aol.com> | 2016-12-14 16:19:07 +0100 |
---|---|---|
committer | Wuzzy <almikes@aol.com> | 2016-12-14 16:19:07 +0100 |
commit | e4bb77dc56575c21468da927bf3a74316726266a (patch) | |
tree | fd639758b3a3ec237c212d6a94cd6a5774a5c3d2 | |
parent | 38710369567a409dfeabaaada700095316de4a1e (diff) |
Fail gracefully if node has invalid sounds
-rw-r--r-- | init.lua | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -475,7 +475,7 @@ doc.new_category("nodes", { ---- Sounds local function is_silent(def, soundtype) - return def.sounds == nil or def.sounds[soundtype] == nil or def.sounds[soundtype] == "" or (type(data.def.sounds[soundtype]) == "table" and (data.def.sounds[soundtype].name == nil or data.def.sounds[soundtype].name == "")) + return type(def.sounds) ~= "table" or def.sounds[soundtype] == nil or def.sounds[soundtype] == "" or (type(data.def.sounds[soundtype]) == "table" and (data.def.sounds[soundtype].name == nil or data.def.sounds[soundtype].name == "")) end local silentstep, silentdig, silentplace = false, false, false if data.def.walkable and is_silent(data.def, "footstep") then |