--- /dev/null
+unused_args = false
+allow_defined_top = true
+
+ignore = {
+ "131", -- Unused global variable
+ "431", -- Shadowing an upvalue
+ "432", -- Shadowing an upvalue argument
+}
+
+read_globals = {
+ "ItemStack",
+ "INIT",
+ "DIR_DELIM",
+ "dump", "dump2",
+ "fgettext", "fgettext_ne",
+ "vector",
+ "VoxelArea",
+ "profiler",
+ "Settings",
+
+ string = {fields = {"split"}},
+ table = {fields = {"copy", "getn", "indexof", "insert_all"}},
+ math = {fields = {"hypot"}},
+}
+
+globals = {
+ "core",
+ "gamedata",
+ os = { fields = { "tempfolder" } },
+ "_",
+}
+
+files["builtin/client/register.lua"] = {
+ globals = {
+ debug = {fields={"getinfo"}},
+ }
+}
+
+files["builtin/common/misc_helpers.lua"] = {
+ globals = {
+ "dump", "dump2", "table", "math", "string",
+ "fgettext", "fgettext_ne", "basic_dump", "game", -- ???
+ "file_exists", "get_last_folder", "cleanup_path", -- ???
+ },
+}
+
+files["builtin/common/vector.lua"] = {
+ globals = { "vector" },
+}
+
+files["builtin/game/voxelarea.lua"] = {
+ globals = { "VoxelArea" },
+}
+
+files["builtin/game/init.lua"] = {
+ globals = { "profiler" },
+}
+
+files["builtin/common/filterlist.lua"] = {
+ globals = {
+ "filterlist",
+ "compare_worlds", "sort_worlds_alphabetic", "sort_mod_list", -- ???
+ },
+}
+
+files["builtin/mainmenu"] = {
+ globals = {
+ "gamedata",
+ },
+
+ read_globals = {
+ "PLATFORM",
+ },
+}
end
local cmd, param = string.match(message, "^%.([^ ]+) *(.*)")
- param = param or ""
+ param = param or ""
if not cmd then
core.display_chat_message(core.gettext("-!- Empty command"))
local cmd_def = core.registered_chatcommands[cmd]
if cmd_def then
core.set_last_run_mod(cmd_def.mod_origin)
- local _, message = cmd_def.func(param)
- if message then
- core.display_chat_message(message)
+ local _, result = cmd_def.func(param)
+ if result then
+ core.display_chat_message(result)
end
else
core.display_chat_message(core.gettext("-!- Invalid command: ") .. cmd)
--------------------------------------------------------------------------------
function compare_worlds(world1,world2)
-
if world1.path ~= world2.path then
return false
end
local function load_mod_command_tree()
mod_cmds = {}
- local check_player_privs = core.check_player_privs
for name, def in pairs(core.registered_chatcommands) do
mod_cmds[def.mod_origin] = mod_cmds[def.mod_origin] or {}
local cmds = mod_cmds[def.mod_origin]
local function build_privs_formspec(name)
local privs = {}
- for name, def in pairs(core.registered_privileges) do
- privs[#privs + 1] = { name, def }
+ for priv_name, def in pairs(core.registered_privileges) do
+ privs[#privs + 1] = { priv_name, def }
end
table.sort(privs, function(a, b) return a[1] < b[1] end)
if param == "" or param == "all" then
core.show_formspec(name, "__builtin:help_cmds",
build_chatcommands_formspec(name))
- return
+ return
end
return old_help_func(name, param)
if t ~= "table" then
return basic_dump(o)
end
+
-- Contains table -> true/nil of currently nested tables
nested = nested or {}
if nested[o] then
nested[o] = true
indent = indent or "\t"
level = level or 1
- local t = {}
+
+ local ret = {}
local dumped_indexes = {}
for i, v in ipairs(o) do
- t[#t + 1] = dump(v, indent, nested, level + 1)
+ ret[#ret + 1] = dump(v, indent, nested, level + 1)
dumped_indexes[i] = true
end
for k, v in pairs(o) do
k = "["..dump(k, indent, nested, level + 1).."]"
end
v = dump(v, indent, nested, level + 1)
- t[#t + 1] = k.." = "..v
+ ret[#ret + 1] = k.." = "..v
end
end
nested[o] = nil
local end_indent_str = "\n"..string.rep(indent, level - 1)
return string.format("{%s%s%s}",
indent_str,
- table.concat(t, ","..indent_str),
+ table.concat(ret, ","..indent_str),
end_indent_str)
end
- return "{"..table.concat(t, ", ").."}"
+ return "{"..table.concat(ret, ", ").."}"
end
--------------------------------------------------------------------------------
end
local old_itemstack = ItemStack(itemstack)
- local new_itemstack, removed = core.item_place_node(
- itemstack, placer, pointed_thing, param2, prevent_after_place
- )
+ local new_itemstack = core.item_place_node(itemstack, placer,
+ pointed_thing, param2, prevent_after_place)
return infinitestacks and old_itemstack or new_itemstack
end
test_out = core.deserialize(core.serialize(test_in))
assert(test_in.escape_chars == test_out.escape_chars)
assert(test_in.non_european == test_out.non_european)
-
local has_privs, missing_privs = core.check_player_privs(name, cmd_def.privs)
if has_privs then
core.set_last_run_mod(cmd_def.mod_origin)
- local success, message = cmd_def.func(name, param)
- if message then
+ local _, result = cmd_def.func(name, param)
+ if result then
core.chat_send_player(name, message)
end
else
if core.check_player_privs(player_name, privs) then
table.insert(players_with_priv, player_name)
end
- end
+ end
return true, "Players online with the \"" .. param .. "\" privilege: " ..
table.concat(players_with_priv, ", ")
- end
+ end
})
local function handle_grant_command(caller, grantname, grantprivstr)
toname = param:match("^([^ ]+) *$")
raw_password = nil
end
+
if not toname then
return false, "Name field required"
end
- local act_str_past = "?"
- local act_str_pres = "?"
+
+ local act_str_past, act_str_pres
if not raw_password then
core.set_player_password(toname, "")
act_str_past = "cleared"
act_str_past = "set"
act_str_pres = "sets"
end
+
if toname ~= name then
core.chat_send_player(toname, "Your password was "
.. act_str_past .. " by " .. name)
end
- core.log("action", name .. " " .. act_str_pres
- .. " password of " .. toname .. ".")
+ core.log("action", name .. " " .. act_str_pres ..
+ " password of " .. toname .. ".")
return true, "Password of player \"" .. toname .. "\" " .. act_str_past
end,
return pos, false
end
- local teleportee = nil
local p = {}
p.x, p.y, p.z = string.match(param, "^([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
p.x = tonumber(p.x)
p.y = tonumber(p.y)
p.z = tonumber(p.z)
if p.x and p.y and p.z then
+
local lm = 31000
if p.x < -lm or p.x > lm or p.y < -lm or p.y > lm or p.z < -lm or p.z > lm then
return false, "Cannot teleport out of map bounds!"
end
- teleportee = core.get_player_by_name(name)
+ local teleportee = core.get_player_by_name(name)
if teleportee then
teleportee:set_pos(p)
return true, "Teleporting to "..core.pos_to_string(p)
end
end
- local teleportee = nil
- local p = nil
- local target_name = nil
- target_name = param:match("^([^ ]+)$")
- teleportee = core.get_player_by_name(name)
+ local target_name = param:match("^([^ ]+)$")
+ local teleportee = core.get_player_by_name(name)
+
+ p = nil
if target_name then
local target = core.get_player_by_name(target_name)
if target then
p = target:get_pos()
end
end
+
if teleportee and p then
p = find_free_position_near(p)
teleportee:set_pos(p)
return false, "You don't have permission to teleport other players (missing bring privilege)"
end
- local teleportee = nil
- local p = {}
- local teleportee_name = nil
+ teleportee = nil
+ p = {}
+ local teleportee_name
teleportee_name, p.x, p.y, p.z = param:match(
"^([^ ]+) +([%d.-]+)[, ] *([%d.-]+)[, ] *([%d.-]+)$")
p.x, p.y, p.z = tonumber(p.x), tonumber(p.y), tonumber(p.z)
.. " to " .. core.pos_to_string(p)
end
- local teleportee = nil
- local p = nil
- local teleportee_name = nil
- local target_name = nil
+ teleportee = nil
+ p = nil
teleportee_name, target_name = string.match(param, "^([^ ]+) +([^ ]+)$")
if teleportee_name then
teleportee = core.get_player_by_name(teleportee_name)
core.settings:set(setname, setvalue)
return true, setname .. " = " .. setvalue
end
- local setname, setvalue = string.match(param, "([^ ]+) (.+)")
+
+ setname, setvalue = string.match(param, "([^ ]+) (.+)")
if setname and setvalue then
if not core.settings:get(setname) then
return false, "Failed. Use '/set -n <name> <value>' to create a new setting."
core.settings:set(setname, setvalue)
return true, setname .. " = " .. setvalue
end
- local setname = string.match(param, "([^ ]+)")
+
+ setname = string.match(param, "([^ ]+)")
if setname then
- local setvalue = core.settings:get(setname)
+ setvalue = core.settings:get(setname)
if not setvalue then
setvalue = "<not set>"
end
return true, setname .. " = " .. setvalue
end
+
return false, "Invalid parameters (see /help set)."
end,
})
end
core.log("action", name .. " pulverized \"" ..
wielded_item:get_name() .. " " .. wielded_item:get_count() .. "\"")
- player:set_wielded_item(nil)
+ player:set_wielded_item(nil)
return true, "An item was pulverized."
end,
})
end
local target_name, seconds = string.match(param, ":([^ ]+) *(%d*)")
if not target_name then
- local player_name = nil
+ local player_name
player_name, seconds = string.match(param, "([^ ]+) *(%d*)")
if not player_name then
return false, "Invalid parameters. See /help rollback"
-- periodical forceload persistence
local function periodically_persist_forceloaded_blocks()
-
+
-- only persist if the blocks actually changed
if forceload_blocks_changed then
persist_forceloaded_blocks()
-- Extended drop table
local got_items = {}
local got_count = 0
- local _, item, tool
for _, item in ipairs(drop.items) do
local good_rarity = true
local good_tool = true
end
-- Run script hook
- local _, callback
for _, callback in ipairs(core.registered_on_dignodes) do
local origin = core.callback_origins[callback]
if origin then
core.set_last_run_mod(origin.mod)
- --print("Running " .. tostring(callback) ..
- -- " (a " .. origin.name .. " callback in " .. origin.mod .. ")")
- else
- --print("No data associated with callback")
end
-- Copy pos and node because callback can modify them
core.register_on_joinplayer(function(player)
local player_name = player:get_player_name()
player_list[player_name] = player
- if not minetest.is_singleplayer() then
+ if not core.is_singleplayer() then
local status = core.get_server_status(player_name, true)
if status and status ~= "" then
core.chat_send_player(player_name, status)
def.description = "(no description)"
end
end
- local def = {}
+ local def
if type(param) == "table" then
def = param
else
-- Alias the forbidden item names to "" so they can't be
-- created via itemstrings (e.g. /give)
-local name
for name in pairs(forbidden_item_names) do
core.registered_aliases[name] = ""
register_alias_raw(name, "")
drop = "",
groups = {not_in_creative_inventory=1},
on_place = function(itemstack, placer, pointed_thing)
- minetest.chat_send_player(
+ core.chat_send_player(
placer:get_player_name(),
- minetest.colorize("#FF0000",
+ core.colorize("#FF0000",
"You can't place 'ignore' nodes!"))
return ""
end,
local origin = core.callback_origins[callbacks[i]]
if origin then
core.set_last_run_mod(origin.mod)
- --print("Running " .. tostring(callbacks[i]) ..
- -- " (a " .. origin.name .. " callback in " .. origin.mod .. ")")
- else
- --print("No data associated with callback")
end
local cb_ret = callbacks[i](...)
core.registered_on_player_hpchanges = { modifiers = { }, loggers = { } }
function core.registered_on_player_hpchange(player, hp_change, reason)
- local last = false
+ local last
for i = #core.registered_on_player_hpchanges.modifiers, 1, -1 do
local func = core.registered_on_player_hpchanges.modifiers[i]
hp_change, last = func(player, hp_change, reason)
-- cache setting
local enable_damage = core.settings:get_bool("enable_damage")
-local health_bar_definition =
-{
+local health_bar_definition = {
hud_elem_type = "statbar",
position = { x=0.5, y=1 },
text = "heart.png",
offset = { x=(-10*24)-25, y=-(48+24+16)},
}
-local breath_bar_definition =
-{
+local breath_bar_definition = {
hud_elem_type = "statbar",
position = { x=0.5, y=1 },
text = "bubble.png",
local current = player["get_" .. field](player)
local nominal = core["PLAYER_MAX_".. field:upper() .. "_DEFAULT"]
local max_display = math.max(nominal,
- math.max(player:get_properties()[field .. "_max"], current))
- return current / max_display * nominal
+ math.max(player:get_properties()[field .. "_max"], current))
+ return current / max_display * nominal
end
local function update_builtin_statbars(player)
local immortal = player:get_armor_groups().immortal == 1
if flags.healthbar and enable_damage and not immortal then
local number = scaleToDefault(player, "hp")
- if hud.id_healthbar == nil then
- local hud_def = table.copy(health_bar_definition)
+ if hud.id_healthbar == nil then
+ local hud_def = table.copy(health_bar_definition)
hud_def.number = number
hud.id_healthbar = player:hud_add(hud_def)
else
player:get_breath() < breath_max then
local number = 2 * scaleToDefault(player, "breath")
if hud.id_breathbar == nil then
- local hud_def = table.copy(breath_bar_definition)
+ local hud_def = table.copy(breath_bar_definition)
hud_def.number = number
hud.id_breathbar = player:hud_add(hud_def)
else
return false
end
-function core.hud_replace_builtin(name, definition)
+function core.hud_replace_builtin(hud_name, definition)
if type(definition) ~= "table" or
definition.hud_elem_type ~= "statbar" then
return false
end
- if name == "health" then
+ if hud_name == "health" then
health_bar_definition = definition
for name, ids in pairs(hud_ids) do
return true
end
- if name == "breath" then
+ if hud_name == "breath" then
breath_bar_definition = definition
for name, ids in pairs(hud_ids) do
end
end
- local details = ""
local grey_out = not is_server_protocol_compat(spec.proto_min, spec.proto_max)
+ local details
if is_favorite then
details = "1,"
else
end
if spec.clients and spec.clients_max then
- local clients_color = ''
local clients_percent = 100 * spec.clients / spec.clients_max
-- Choose a color depending on how many clients are connected
-- (relatively to clients_max)
+ local clients_color
if grey_out then clients_color = '#aaaaaa'
elseif spec.clients == 0 then clients_color = '' -- 0 players: default/white
elseif clients_percent <= 60 then clients_color = '#a1e587' -- 0-60%: green
local filetocheck = os.tmpname()
os.remove(filetocheck)
+ -- luacheck: ignore
-- https://blogs.msdn.microsoft.com/vcblog/2014/06/18/c-runtime-crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1/
-- The C runtime (CRT) function called by os.tmpname is tmpnam.
-- Microsofts tmpnam implementation in older CRT / MSVC releases is defective.
assert(core.create_dir(tmpdir))
local base_url = core.settings:get("contentdb_url")
- local show_nonfree = core.settings:get_bool("show_nonfree_packages")
local url = base_url ..
"/api/packages/?type=mod&type=game&type=txp&protocol_version=" ..
core.get_max_supp_proto()
local current_mg = core.settings:get("mg_name")
local gameid = core.settings:get("menu_last_game")
- local game, gameidx = nil , 0
+ local gameidx = 0
if gameid ~= nil then
- game, gameidx = pkgmgr.find_by_gameid(gameid)
-
+ _, gameidx = pkgmgr.find_by_gameid(gameid)
+
if gameidx == nil then
gameidx = 0
end
"button[3.25,6;2.5,0.5;world_create_confirm;" .. fgettext("Create") .. "]" ..
"button[5.75,6;2.5,0.5;world_create_cancel;" .. fgettext("Cancel") .. "]"
-
+
if #pkgmgr.games == 0 then
retval = retval .. "box[2,4;8,1;#ff8800]label[2.25,4;" ..
fgettext("You have no games installed.") .. "]label[2.25,4.4;" ..
local random_world_name = "Unnamed" .. random_number
worldname = random_world_name
end
- local message = nil
core.settings:set("fixed_map_seed", fields["te_seed"])
+ local message
if not menudata.worldlist:uid_exists_raw(worldname) then
core.settings:set("mg_name",fields["dd_mapgen"])
message = core.create_world(worldname,gameindex)
create_world_buttonhandler,
nil)
retval.update_worldlist_filter = update_worldlistfilter
-
+
return retval
end
local values = {}
local ti = 1
local index = 1
- for line in default:gmatch("[+-]?[%d.-e]+") do -- All numeric characters
- index = default:find("[+-]?[%d.-e]+", index) + line:len()
- table.insert(values, line)
+ for match in default:gmatch("[+-]?[%d.-e]+") do -- All numeric characters
+ index = default:find("[+-]?[%d.-e]+", index) + match:len()
+ table.insert(values, match)
ti = ti + 1
if ti > 9 then
break
-- read_all: whether to ignore certain setting types for GUI or not
-- parse_mods: whether to parse settingtypes.txt in mods and games
local function parse_config_file(read_all, parse_mods)
- local builtin_path = core.get_builtin_path() .. FILENAME
- local file = io.open(builtin_path, "r")
local settings = {}
- if not file then
- core.log("error", "Can't load " .. FILENAME)
- return settings
- end
- parse_single_file(file, builtin_path, read_all, settings, 0, true)
+ do
+ local builtin_path = core.get_builtin_path() .. FILENAME
+ local file = io.open(builtin_path, "r")
+ if not file then
+ core.log("error", "Can't load " .. FILENAME)
+ return settings
+ end
+
+ parse_single_file(file, builtin_path, read_all, settings, 0, true)
- file:close()
+ file:close()
+ end
if parse_mods then
-- Parse games
local file = io.open(path, "r")
if file then
if not games_category_initialized then
- local translation = fgettext_ne("Games"), -- not used, but needed for xgettext
+ fgettext_ne("Games") -- not used, but needed for xgettext
table.insert(settings, {
name = "Games",
level = 0,
local file = io.open(path, "r")
if file then
if not mods_category_initialized then
- local translation = fgettext_ne("Mods"), -- not used, but needed for xgettext
+ fgettext_ne("Mods") -- not used, but needed for xgettext
table.insert(settings, {
name = "Mods",
level = 0,
" (" .. setting.name .. ")"
end
- local comment_text = ""
+ local comment_text
if setting.comment == "" then
comment_text = fgettext_ne("(No description of setting given)")
else
return false
end
-local function create_settings_formspec(tabview, name, tabdata)
+local function create_settings_formspec(tabview, _, tabdata)
local formspec = "size[12,5.4;true]" ..
"tablecolumns[color;tree;text,width=28;text]" ..
"tableoptions[background=#00000000;border=false]" ..
formspec = formspec .. "," .. (current_level + 1) .. "," .. core.formspec_escape(name) .. ","
.. value .. ","
- elseif entry.type == "key" then
+ elseif entry.type == "key" then --luacheck: ignore
-- ignore key settings, since we have a special dialog for them
elseif entry.type == "noise_params_2d" or entry.type == "noise_params_3d" then
if fields["btn_edit"] or list_enter then
local setting = settings[selected_setting]
if setting and setting.type ~= "category" then
- local edit_dialog = dialog_create("change_setting", create_change_setting_formspec,
- handle_change_setting_buttons)
+ local edit_dialog = dialog_create("change_setting",
+ create_change_setting_formspec, handle_change_setting_buttons)
edit_dialog:set_parent(this)
this:hide()
edit_dialog:show()
-- For RUN_IN_PLACE the generated files may appear in the 'bin' folder.
-- See comment and alternative line at the end of 'generate_from_settingtypes.lua'.
---assert(loadfile(core.get_builtin_path().."mainmenu"..DIR_DELIM.."generate_from_settingtypes.lua"))(parse_config_file(true, false))
+--assert(loadfile(core.get_builtin_path().."mainmenu"..DIR_DELIM..
+-- "generate_from_settingtypes.lua"))(parse_config_file(true, false))
end
--------------------------------------------------------------------------------
function pkgmgr.render_packagelist(render_list)
- local retval = ""
-
if render_list == nil then
if pkgmgr.global_mods == nil then
pkgmgr.refresh_globals()
end
local list = render_list:get_list()
- local last_modpack = nil
local retval = {}
for i, v in ipairs(list) do
local color = ""
else
return nil,
fgettext("Install Mod: Unable to find suitable folder name for modpack $1",
- modfilename)
+ path)
end
end
elseif basefolder.type == "mod" then
if targetfolder ~= nil and pkgmgr.isValidModname(targetfolder) then
targetpath = core.get_modpath() .. DIR_DELIM .. targetfolder
else
- return nil, fgettext("Install Mod: Unable to find real mod name for: $1", modfilename)
+ return nil, fgettext("Install Mod: Unable to find real mod name for: $1", path)
end
end
if enable_gamebar then
function current_game()
local last_game_id = core.settings:get("menu_last_game")
- local game, index = pkgmgr.find_by_gameid(last_game_id)
+ local game = pkgmgr.find_by_gameid(last_game_id)
return game
end
--update last game
local world = menudata.worldlist:get_raw_element(gamedata.selected_world)
if world then
- local game, index = pkgmgr.find_by_gameid(world.gameid)
+ local game = pkgmgr.find_by_gameid(world.gameid)
core.settings:set("menu_last_game", game.id)
end
-- Update the cached supported proto info,
-- it may have changed after a change by the settings menu.
common_update_cached_supp_proto()
- local fav_selected = nil
+ local fav_selected
if menudata.search_result then
fav_selected = menudata.search_result[tabdata.fav_selected]
else
for k = 1, #keywords do
local keyword = keywords[k]
if server.name then
- local name = server.name:lower()
- local _, count = name:gsub(keyword, keyword)
+ local sername = server.name:lower()
+ local _, count = sername:gsub(keyword, keyword)
found = found + count * 4
end
core.create_world("singleplayerworld", 1)
worldlist = core.get_worlds()
- found_singleplayerworld = false
for i = 1, #worldlist do
if worldlist[i].name == "singleplayerworld" then
- found_singleplayerworld = true
gamedata.worldindex = i
end
end
core.settings:set("address", fields.te_address)
core.settings:set("remote_port", fields.te_port)
-
- core.start()
- return true
- end
+
+ core.start()
+ return true
+ end
if fields.btn_config_sp_world then
local configdialog = create_configure_world_dlg(1)
mm_texture.defaulttexturedir = core.get_texturepath() .. DIR_DELIM .. "base" ..
DIR_DELIM .. "pack" .. DIR_DELIM
mm_texture.basetexturedir = mm_texture.defaulttexturedir
-
+
mm_texture.texturepack = core.settings:get("texture_path")
-
+
mm_texture.gameid = nil
end
if gamedetails == nil then
return
end
-
+
mm_texture.update_game(gamedetails)
end
mm_texture.gameid = nil
local have_bg = false
local have_overlay = mm_texture.set_generic("overlay")
-
+
if not have_overlay then
have_bg = mm_texture.set_generic("background")
end
-
+
mm_texture.clear("header")
mm_texture.clear("footer")
core.set_clouds(false)
-
+
mm_texture.set_generic("footer")
mm_texture.set_generic("header")
-
+
if not have_bg then
if core.settings:get_bool("menu_clouds") then
core.set_clouds(true)
if mm_texture.gameid == gamedetails.id then
return
end
-
+
local have_bg = false
local have_overlay = mm_texture.set_game("overlay",gamedetails)
-
+
if not have_overlay then
have_bg = mm_texture.set_game("background",gamedetails)
end
-
+
mm_texture.clear("header")
mm_texture.clear("footer")
core.set_clouds(false)
-
+
if not have_bg then
-
+
if core.settings:get_bool("menu_clouds") then
core.set_clouds(true)
else
mm_texture.set_dirt_bg()
end
end
-
+
mm_texture.set_game("footer",gamedetails)
mm_texture.set_game("header",gamedetails)
-
+
mm_texture.gameid = gamedetails.id
end
return true
end
end
-
+
if mm_texture.defaulttexturedir ~= nil then
local path = mm_texture.defaulttexturedir .. DIR_DELIM .."menu_" ..
identifier .. ".png"
return true
end
end
-
+
return false
end
--------------------------------------------------------------------------------
function mm_texture.set_game(identifier, gamedetails)
-
+
if gamedetails == nil then
return false
end
return true
end
end
-
+
-- Find out how many randomized textures the game provides
local n = 0
local filename
if core.set_background(identifier, path) then
return true
end
-
+
return false
end
return true
end
end
-
+
-- Use universal fallback texture in textures/base/pack
local minimalpath = defaulttexturedir .. "menu_bg.png"
core.set_background("background", minimalpath, true, 128)
local function assert_can_be_called(func, func_name, level)
if not can_be_called(func) then
-- Then throw an *helpful* error, by pointing on our caller instead of us.
- error(format("Invalid argument to %s. Expected function-like type instead of '%s'.", func_name, type(func)), level + 1)
+ error(format("Invalid argument to %s. Expected function-like type instead of '%s'.",
+ func_name, type(func)), level + 1)
end
end