]> git.lizzy.rs Git - minetest.git/blob - builtin/game/features.lua
Prevent null concatenation when /deleteblocks is provided an incorrect format
[minetest.git] / builtin / game / features.lua
1 -- Minetest: builtin/features.lua
2
3 core.features = {
4         glasslike_framed = true,
5         nodebox_as_selectionbox = true,
6         chat_send_player_param3 = true,
7         get_all_craft_recipes_works = true,
8         use_texture_alpha = true,
9         no_legacy_abms = true,
10         texture_names_parens = true,
11 }
12
13 function core.has_feature(arg)
14         if type(arg) == "table" then
15                 missing_features = {}
16                 result = true
17                 for ft, _ in pairs(arg) do
18                         if not core.features[ftr] then
19                                 missing_features[ftr] = true
20                                 result = false
21                         end
22                 end
23                 return result, missing_features
24         elseif type(arg) == "string" then
25                 if not core.features[arg] then
26                         return false, {[arg]=true}
27                 end
28                 return true, {}
29         end
30 end