Remove settings legacy, require 0.4.15-dev or newer

This commit is contained in:
SmallJoker 2017-10-03 08:35:20 +02:00
parent e8119a63cd
commit 2229ededa5
2 changed files with 7 additions and 9 deletions

View File

@ -376,7 +376,7 @@ if not boost_cart.mtg_compat then
return return
end end
if not minetest.setting_getbool("creative_mode") then if not minetest.settings:get_bool("creative_mode") then
itemstack:take_item() itemstack:take_item()
end end
return itemstack return itemstack

View File

@ -3,18 +3,16 @@ boost_cart = {}
boost_cart.modpath = minetest.get_modpath("boost_cart") boost_cart.modpath = minetest.get_modpath("boost_cart")
-- Settings glue for <= 0.4.15 if not minetest.settings then
local setting_getter = minetest.setting_get error("[boost_cart] Your Minetest version is no longer supported."
if minetest.settings then .. " (Version <= 0.4.15)")
setting_getter = function (key)
return minetest.settings:get(key)
end
end end
-- Maximal speed of the cart in m/s -- Maximal speed of the cart in m/s
boost_cart.speed_max = tonumber(setting_getter("boost_cart.speed_max")) or 10 boost_cart.speed_max = tonumber(minetest.settings:get("boost_cart.speed_max")) or 10
-- Set to -1 to disable punching the cart from inside -- Set to -1 to disable punching the cart from inside
boost_cart.punch_speed_max = tonumber(setting_getter("boost_cart.punch_speed_max")) or 7 boost_cart.punch_speed_max =
tonumber(minetest.settings:get("boost_cart.punch_speed_max")) or 7
-- Support for non-default games -- Support for non-default games
if not default.player_attached then if not default.player_attached then